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