forked from oxc-project/oxc
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 2.07 KB
/
benchmark.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
name: Benchmark
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- '**/*.rs'
- 'Cargo.lock'
- '.github/workflows/benchmark.yml'
push:
branches:
- main
- bench-*
paths:
- '**/*.rs'
- 'Cargo.lock'
- '.github/workflows/benchmark.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v4
with:
progress: false
persist-credentials: false
- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
shared-key: 'benchmark'
save-cache: ${{ github.ref_name == 'main' }}
- name: Install codspeed
uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed
- name: Build Benchmark
env:
RUSTFLAGS: "-C debuginfo=2 -C strip=none -g --cfg codspeed"
shell: bash
run: |
cargo build --release -p oxc_benchmark --features codspeed --bench lexer --bench parser --bench transformer --bench semantic --bench linter --bench minifier --bench codegen_sourcemap
mkdir -p target/codspeed/oxc_benchmark/
mv target/release/deps/lexer-* target/codspeed/oxc_benchmark
mv target/release/deps/parser-* target/codspeed/oxc_benchmark
mv target/release/deps/transformer-* target/codspeed/oxc_benchmark
mv target/release/deps/semantic-* target/codspeed/oxc_benchmark
mv target/release/deps/linter-* target/codspeed/oxc_benchmark
mv target/release/deps/minifier-* target/codspeed/oxc_benchmark
mv target/release/deps/codegen_sourcemap-* target/codspeed/oxc_benchmark
rm -rf target/codspeed/oxc_benchmark/*.d
- name: Run benchmark
uses: CodSpeedHQ/action@v2
timeout-minutes: 30
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}