plonky2-u32/.github/workflows/continuous-integration.yml
.github/workflows/continuous-integration.ymlRaw
1name: Continuous Integration
2
3on:
4 push:
5 branches: [main]
6 pull_request:
7 branches:
8 - "**"
9
10jobs:
11 test:
12 name: Test Suite
13 runs-on: ubuntu-latest
14 if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
15 steps:
16 - name: Checkout sources
17 uses: actions/checkout@v2
18
19 - name: Install nightly toolchain
20 id: rustc-toolchain
21 uses: actions-rs/toolchain@v1
22 with:
23 profile: minimal
24 toolchain: nightly
25 override: true
26
27 - name: rust-cache
28 uses: actions/cache@v3
29 with:
30 path: |
31 ~/.cargo/bin/
32 ~/.cargo/registry/index/
33 ~/.cargo/registry/cache/
34 ~/.cargo/git/db/
35 target/
36 key: rustc-test-${{ steps.rustc-toolchain.outputs.rustc_hash }}-cargo-${{ hashFiles('**/Cargo.toml') }}
37
38 - name: Run cargo test
39 uses: actions-rs/cargo@v1
40 with:
41 command: test
42 args: --workspace
43 env:
44 RUSTFLAGS: -Copt-level=3 -Cdebug-assertions -Coverflow-checks=y -Cdebuginfo=0
45 RUST_LOG: 1
46 CARGO_INCREMENTAL: 1
47 RUST_BACKTRACE: 1
48
49 lints:
50 name: Formatting and Clippy
51 runs-on: ubuntu-latest
52 if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')"
53 steps:
54 - name: Checkout sources
55 uses: actions/checkout@v2
56
57 - name: Install nightly toolchain
58 id: rustc-toolchain
59 uses: actions-rs/toolchain@v1
60 with:
61 profile: minimal
62 toolchain: nightly
63 override: true
64 components: rustfmt, clippy
65
66 - name: rust-cache
67 uses: actions/cache@v3
68 with:
69 path: |
70 ~/.cargo/bin/
71 ~/.cargo/registry/index/
72 ~/.cargo/registry/cache/
73 ~/.cargo/git/db/
74 target/
75 key: rustc-lints-${{ steps.rustc-toolchain.outputs.rustc_hash }}-cargo-${{ hashFiles('**/Cargo.toml') }}
76
77 - name: Run cargo fmt
78 uses: actions-rs/cargo@v1
79 with:
80 command: fmt
81 args: --all -- --check
82 env:
83 CARGO_INCREMENTAL: 1
84
85 - name: Run cargo clippy
86 uses: actions-rs/cargo@v1
87 with:
88 command: clippy
89 args: --all-features --all-targets -- -D warnings -A incomplete-features
90 env:
91 # Seems necessary until https://github.com/rust-lang/rust/pull/115819 is merged.
92 CARGO_INCREMENTAL: 0