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 shell: bash -euxo pipefail {0}
32 - name: steps::setup_linux
33 run: ./script/linux
34 shell: bash -euxo pipefail {0}
35 - name: steps::install_mold
36 run: ./script/install-mold
37 shell: bash -euxo pipefail {0}
38 - name: steps::download_wasi_sdk
39 run: ./script/download-wasi-sdk
40 shell: bash -euxo pipefail {0}
41 - name: compare_perf::run_perf::install_hyperfine
42 run: cargo install hyperfine
43 shell: bash -euxo pipefail {0}
44 - name: steps::git_checkout
45 run: git fetch origin ${{ inputs.base }} && git checkout ${{ inputs.base }}
46 shell: bash -euxo pipefail {0}
47 - name: compare_perf::run_perf::cargo_perf_test
48 run: |2-
49
50 if [ -n "${{ inputs.crate_name }}" ]; then
51 cargo perf-test -p ${{ inputs.crate_name }} -- --json=${{ inputs.base }};
52 else
53 cargo perf-test -p vim -- --json=${{ inputs.base }};
54 fi
55 shell: bash -euxo pipefail {0}
56 - name: steps::git_checkout
57 run: git fetch origin ${{ inputs.head }} && git checkout ${{ inputs.head }}
58 shell: bash -euxo pipefail {0}
59 - name: compare_perf::run_perf::cargo_perf_test
60 run: |2-
61
62 if [ -n "${{ inputs.crate_name }}" ]; then
63 cargo perf-test -p ${{ inputs.crate_name }} -- --json=${{ inputs.head }};
64 else
65 cargo perf-test -p vim -- --json=${{ inputs.head }};
66 fi
67 shell: bash -euxo pipefail {0}
68 - name: compare_perf::run_perf::compare_runs
69 run: cargo perf-compare --save=results.md ${{ inputs.base }} ${{ inputs.head }}
70 shell: bash -euxo pipefail {0}
71 - name: '@actions/upload-artifact results.md'
72 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
73 with:
74 name: results.md
75 path: results.md
76 if-no-files-found: error
77 - name: steps::cleanup_cargo_config
78 if: always()
79 run: |
80 rm -rf ./../.cargo
81 shell: bash -euxo pipefail {0}