-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (37 loc) · 1.24 KB
/
scheduled_bench.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
name: Scheduled Bench
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
bench:
runs-on: [self-hosted, rspack-bench]
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Init env
uses: ./.github/actions/env
- name: Build rspack
run: node bin/build-rspack.js
- name: Run benchmark
run: node bin/bench.js
- id: print-compare-results
name: Print compare results
run: |
result=$(node bin/compare-bench.js latest current)
echo "$result"
echo "diff-result=${result//$'\n'/'@@'}" >> $GITHUB_OUTPUT
- name: Setup git user
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Upload result
run: node bin/upload.js ${{ secrets.GITHUB_TOKEN }}
- 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