Skip to content

Commit bb64c76

Browse files
committed
CI: Run benchmarks separately to tests
Signed-off-by: Nico Burns <[email protected]>
1 parent 631dbf5 commit bb64c76

File tree

1 file changed

+38
-12
lines changed

1 file changed

+38
-12
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ on:
88
types: [checks_requested]
99

1010
jobs:
11-
ci:
11+
build-and-test:
1212
name: CI
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
version: [stable, beta, nightly]
16+
version: [stable, beta]
1717
steps:
1818
- uses: actions/checkout@v4
1919

@@ -25,22 +25,45 @@ jobs:
2525
- name: Init submodules
2626
run: git submodule update --init
2727

28-
- name: Cargo bench
29-
run: cargo bench --all
30-
env:
31-
RUSTFLAGS: --cfg bench
28+
- name: Cargo build
29+
run: cargo build --all
3230

3331
- name: Cargo test
34-
if: matrix.version != 'nightly'
3532
run: cargo test --all
3633

3734
- name: Test tendril w/encoding feature
38-
if: matrix.version != 'nightly'
3935
run: cargo test -p tendril --features 'encoding encoding_rs'
4036

41-
- name: Cargo doc
42-
if: matrix.version == 'nightly'
43-
run: cargo doc
37+
doc:
38+
name: Cargo doc
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Set toolchain
43+
run: |
44+
rustup set profile minimal
45+
rustup override set nightly
46+
- run: cargo doc
47+
env:
48+
RUSTFLAGS: --cfg bench
49+
50+
bench-html5ever:
51+
name: Bench html5ever
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
- run: cargo bench -p html5ever
56+
env:
57+
RUSTFLAGS: --cfg bench
58+
59+
bench-tendril:
60+
name: Bench tendril
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v4
64+
- run: cargo bench -p tendril -- --quick
65+
env:
66+
RUSTFLAGS: --cfg bench
4467

4568
msrv:
4669
name: MSRV
@@ -83,9 +106,12 @@ jobs:
83106
name: Result
84107
runs-on: ubuntu-latest
85108
needs:
86-
- ci
109+
- build-and-test
110+
- doc
87111
- lint
88112
- msrv
113+
- bench-html5ever
114+
- bench-tendril
89115

90116
steps:
91117
- name: Success

0 commit comments

Comments
 (0)