-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (68 loc) · 2.19 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CI
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
pull_request:
types: [opened, synchronize]
branches: [main]
paths-ignore:
- "**/*.md"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
get-runner-labels:
name: Get Runner Labels
uses: ./.github/workflows/get-runner-labels.yml
# prepare-binding:
# name: Prepare Rspack Binding
# needs: [get-runner-labels]
# runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
# steps:
# - uses: actions/checkout@v4
# - name: Init env
# uses: ./.github/actions/env
# - uses: ./.github/actions/prepare-rspack-binding
# with:
# path: ${{ env.RSPACK_DIR }}
bench:
# needs: [get-runner-labels, prepare-binding]
needs: [get-runner-labels]
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
timeout-minutes: 30
strategy:
matrix:
shardIndex: [1]
shardTotal: [1]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init env
uses: ./.github/actions/env
# - uses: ./.github/actions/build-rspack
# with:
# path: ${{ env.RSPACK_DIR }}
# - name: Run benchmark
# run: node bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
with:
run: pnpm exec vitest bench
token: ${{ secrets.CODSPEED_TOKEN }}
- id: print-compare-results
name: Print compare results
run: |
result=$(node bin/cli.js compare --base latest --current current)
echo "$result"
echo "diff-result=${result//$'\n'/'@@'}" >> $GITHUB_OUTPUT
- name: Check Threshold
run: |
result='${{ steps.print-compare-results.outputs.diff-result }}';
if [[ $result =~ "Threshold exceeded" ]]; then
echo "Some benchmark cases exceed the threshold, please visit the previous step for more information"
exit 1
fi