File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,20 +2,41 @@ name: Build and test code
22
33on :
44 push :
5- branches : [ "main" ]
5+ branches : [main]
6+ paths-ignore :
7+ - " **.md"
8+ - " LICENSE*"
9+ - " .github/workflows/docs.yml"
10+ - " katex-header.html"
611 pull_request :
7- branches : [ "main" ]
12+ branches : [main]
13+ paths-ignore :
14+ - " **.md"
15+ - " LICENSE*"
16+ - " .github/workflows/docs.yml"
17+ - " katex-header.html"
18+
19+ permissions :
20+ contents : read
21+
22+ concurrency :
23+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+ cancel-in-progress : true
825
926env :
1027 CARGO_TERM_COLOR : always
1128 CARGO_INCREMENTAL : 0
1229
1330jobs :
1431 build :
32+ if : github.event.pull_request.draft == false
1533 runs-on : ubuntu-latest
34+ timeout-minutes : 30
1635 steps :
17- - uses : actions/checkout@v4
18- - name : Build
19- run : cargo test --workspace --verbose --no-run
20- - name : Run tests
21- run : cargo test --workspace --verbose
36+ - uses : actions/checkout@v4
37+ - uses : dtolnay/rust-toolchain@stable
38+ - uses : Swatinem/rust-cache@v2
39+ - name : Build
40+ run : cargo test --workspace --verbose --no-run
41+ - name : Run tests
42+ run : cargo test --workspace --verbose
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -3,8 +3,16 @@ name: Dependency security audit
33on :
44 push :
55 paths :
6- - ' **/Cargo.toml'
7- - ' **/Cargo.lock'
6+ - " **/Cargo.toml"
7+ - " **/Cargo.lock"
8+ - " deny.toml"
9+
10+ permissions :
11+ contents : read
12+
13+ concurrency :
14+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+ cancel-in-progress : true
816
917env :
1018 CARGO_TERM_COLOR : always
@@ -14,28 +22,14 @@ jobs:
1422 security_audit :
1523 timeout-minutes : 10
1624 runs-on : ubuntu-latest
17- permissions :
18- contents : read
19- checks : write
2025 steps :
2126 - name : Check out
2227 uses : actions/checkout@v4
2328
24- - name : Cache audit-check build
25- id : cache-audit-check
26- uses : actions/cache@v4
27- continue-on-error : false
28- with :
29- path : |
30- ~/.cargo/bin/
31- ~/.cargo/registry/index/
32- ~/.cargo/registry/cache/
33- ~/.cargo/git/db/
34- target/
35- key : ${{ runner.os }}-cargo-deny-${{ hashFiles('**/Cargo.lock') }}
36- restore-keys : ${{ runner.os }}-cargo-deny
37-
38- - name : Run audit-check action
39- run : |
40- which cargo-deny || cargo install cargo-deny
41- cargo deny check
29+ - uses : dtolnay/rust-toolchain@stable
30+
31+ - name : Install cargo-deny
32+ uses : taiki-e/install-action@cargo-deny
33+
34+ - name : Run cargo deny
35+ run : cargo deny check
Original file line number Diff line number Diff line change @@ -5,27 +5,34 @@ name: Docs
55on :
66 workflow_dispatch :
77
8+ permissions :
9+ contents : read
10+
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+ cancel-in-progress : true
14+
815jobs :
916 # TODO(template) remove docs publishing, when the crate is published to crates.io
1017 docs :
11- permissions :
12- contents : write
1318 name : Documentation
1419 runs-on : ubuntu-latest
20+ timeout-minutes : 15
1521 steps :
1622 - name : Checkout source code
1723 uses : actions/checkout@v4
1824 with :
1925 fetch-depth : 1
2026 persist-credentials : false
2127
28+ - uses : dtolnay/rust-toolchain@stable
29+
30+ - uses : Swatinem/rust-cache@v2
31+
2232 - name : Setup pages
2333 id : pages
2434 uses : actions/configure-pages@v5
2535
26- - name : Clean docs folder
27- run : cargo clean --doc
28-
2936 # Documentation with Latex support
3037 # TODO(template) if Latex is not needed
3138 # just remove katex-header.html at the root and RUSTDOCFLAGS here
4956 name : github-pages
5057 url : ${{ steps.deployment.outputs.page_url }}
5158 runs-on : ubuntu-latest
59+ timeout-minutes : 5
5260 needs : docs
5361 steps :
5462 - name : Deploy to GitHub Pages
5563 id : deployment
56- uses : actions/deploy-pages@v4
64+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 11name : Linter check
22
3- on : push
3+ on :
4+ push :
5+ branches : [main]
6+ paths-ignore :
7+ - " **.md"
8+ - " LICENSE*"
9+ - " .github/workflows/docs.yml"
10+ - " katex-header.html"
11+ pull_request :
12+ branches : [main]
13+ paths-ignore :
14+ - " **.md"
15+ - " LICENSE*"
16+ - " .github/workflows/docs.yml"
17+ - " katex-header.html"
18+
19+ permissions :
20+ contents : read
21+
22+ concurrency :
23+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+ cancel-in-progress : true
425
526env :
627 CARGO_TERM_COLOR : always
728 CARGO_INCREMENTAL : 0
8- # Make sure CI fails on all warnings, including Clippy lints
9- RUSTFLAGS : " -Dwarnings"
1029
1130jobs :
12- linter_check :
31+ fmt :
1332 runs-on : ubuntu-latest
33+ timeout-minutes : 5
1434 steps :
1535 - uses : actions/checkout@v4
36+ - uses : dtolnay/rust-toolchain@stable
37+ with :
38+ components : rustfmt
1639 - name : Run Fmt
1740 run : cargo fmt --all -- --check
1841
42+ clippy :
43+ runs-on : ubuntu-latest
44+ timeout-minutes : 15
45+ env :
46+ # Make sure CI fails on all warnings, including Clippy lints
47+ RUSTFLAGS : " -Dwarnings"
48+ steps :
49+ - uses : actions/checkout@v4
50+ - uses : dtolnay/rust-toolchain@stable
51+ with :
52+ components : clippy
53+ - uses : Swatinem/rust-cache@v2
1954 - name : Run Clippy
2055 run : cargo clippy --all-targets --all-features
2156
57+ typos :
58+ runs-on : ubuntu-latest
59+ timeout-minutes : 5
60+ steps :
61+ - uses : actions/checkout@v4
2262 - name : Check typos
2363 uses : crate-ci/typos@master
Original file line number Diff line number Diff line change 11name : UB (undefined behavior) detection
22
3- on : push
3+ on :
4+ push :
5+ branches : [main]
6+ paths-ignore :
7+ - " **.md"
8+ - " LICENSE*"
9+ - " .github/workflows/docs.yml"
10+ - " katex-header.html"
11+ pull_request :
12+ branches : [main]
13+ paths-ignore :
14+ - " **.md"
15+ - " LICENSE*"
16+ - " .github/workflows/docs.yml"
17+ - " katex-header.html"
18+
19+ permissions :
20+ contents : read
21+
22+ concurrency :
23+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+ cancel-in-progress : true
425
526env :
627 CARGO_TERM_COLOR : always
1637 runs-on : ubuntu-latest
1738 steps :
1839 - uses : actions/checkout@v4
19- - run : |
20- rustup +nightly component add miri
21- cargo +nightly miri setup
22- PROPTEST_DISABLE_FAILURE_PERSISTENCE=true \
23- MIRIFLAGS="-Zmiri-env-forward=PROPTEST_DISABLE_FAILURE_PERSISTENCE -Zmiri-strict-provenance" \
24- cargo +nightly miri test --lib
40+ - uses : dtolnay/rust-toolchain@nightly
41+ with :
42+ components : miri
43+ - uses : Swatinem/rust-cache@v2
44+ with :
45+ cache-on-failure : true
46+ - name : Run Miri
47+ run : MIRIFLAGS="-Zmiri-strict-provenance" cargo +nightly miri test --lib
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ mod tests {
7171
7272 proptest ! {
7373 #[ test]
74+ #[ cfg_attr( miri, ignore) ]
7475 fn addition_proptest( a in 0_u8 ..20 , b in 0_u8 ..20 ) {
7576 assert_eq!(
7677 a. checked_add( b) ,
You can’t perform that action at this time.
0 commit comments