compare_perf.yml

 1# Generated from xtask::workflows::compare_perf
 2# Rebuild with `cargo xtask workflows`.
 3name: compare_perf
 4on:
 5  workflow_dispatch:
 6    inputs:
 7      head:
 8        description: head
 9        required: true
10        type: string
11      base:
12        description: base
13        required: true
14        type: string
15      crate_name:
16        description: crate_name
17        type: string
18        default: ''
19jobs:
20  run_perf:
21    runs-on: namespace-profile-16x32-ubuntu-2204
22    steps:
23    - name: steps::checkout_repo
24      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25      with:
26        clean: false
27    - name: steps::setup_cargo_config
28      run: |
29        mkdir -p ./../.cargo
30        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
31    - name: steps::setup_linux
32      run: ./script/linux
33    - name: steps::install_mold
34      run: ./script/install-mold
35    - name: steps::download_wasi_sdk
36      run: ./script/download-wasi-sdk
37    - name: compare_perf::run_perf::install_hyperfine
38      uses: taiki-e/install-action@hyperfine
39    - name: steps::git_checkout
40      run: git fetch origin ${{ inputs.base }} && git checkout ${{ inputs.base }}
41    - name: compare_perf::run_perf::cargo_perf_test
42      run: |2-
43
44                    if [ -n "${{ inputs.crate_name }}" ]; then
45                        cargo perf-test -p ${{ inputs.crate_name }} -- --json=${{ inputs.base }};
46                    else
47                        cargo perf-test -p vim -- --json=${{ inputs.base }};
48                    fi
49    - name: steps::git_checkout
50      run: git fetch origin ${{ inputs.head }} && git checkout ${{ inputs.head }}
51    - name: compare_perf::run_perf::cargo_perf_test
52      run: |2-
53
54                    if [ -n "${{ inputs.crate_name }}" ]; then
55                        cargo perf-test -p ${{ inputs.crate_name }} -- --json=${{ inputs.head }};
56                    else
57                        cargo perf-test -p vim -- --json=${{ inputs.head }};
58                    fi
59    - name: compare_perf::run_perf::compare_runs
60      run: cargo perf-compare --save=results.md ${{ inputs.base }} ${{ inputs.head }}
61    - name: '@actions/upload-artifact results.md'
62      uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
63      with:
64        name: results.md
65        path: results.md
66        if-no-files-found: error
67    - name: steps::cleanup_cargo_config
68      if: always()
69      run: |
70        rm -rf ./../.cargo
71defaults:
72  run:
73    shell: bash -euxo pipefail {0}