@@ -3,28 +3,56 @@ name: CodSpeed
3
3
on :
4
4
push :
5
5
branches :
6
- - "develop"
7
- - "codspeed"
8
- # Run on pull requests
6
+ - " main"
7
+ - " codspeed"
9
8
pull_request :
10
9
# `workflow_dispatch` allows CodSpeed to trigger backtest
11
10
# performance analysis in order to generate initial data.
12
11
workflow_dispatch :
13
12
14
13
jobs :
15
- benchmarks :
14
+ codspeed :
16
15
name : Run benchmarks
17
16
runs-on : ubuntu-latest
18
17
steps :
19
18
- uses : actions/checkout@v4
20
19
21
- - name: Setup rust toolchain
20
+ - name : Setup rust toolchain
22
21
uses : dtolnay/rust-toolchain@stable
23
22
with :
24
23
toolchain : ${{ matrix.toolchain }}
25
24
26
- - name: Run benchmarks
25
+ - name : Download builder playground
26
+
27
+ with :
28
+ builder-playground : v0.1.3
29
+
30
+ # https://github.com/swatinem/rust-cache
31
+ - name : Run Swatinem/rust-cache@v2
32
+ uses : Swatinem/rust-cache@v2
33
+ with :
34
+ cache-on-failure : true
35
+
36
+ # https://github.com/Mozilla-Actions/sccache-action
37
+ - name : Run sccache-action
38
+ uses :
mozilla-actions/[email protected]
39
+
40
+ - name : Set sccache env vars
41
+ run : |
42
+ echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
43
+ echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
44
+
45
+ - name : Build the rbuilder
46
+ run : cargo build --features="${{ matrix.features }}"
47
+
48
+ - name : Run the playground
49
+ run : builder-playground &
50
+
51
+ - name : Build the benchmark target(s)
52
+ run : cargo codspeed build
53
+
54
+ - name : Run the benchmarks
27
55
uses : CodSpeedHQ/action@v3
28
56
with :
57
+ run : cargo codspeed run
29
58
token : ${{ secrets.CODSPEED_TOKEN }}
30
- run: "cargo bench"
0 commit comments