-
Notifications
You must be signed in to change notification settings - Fork 14
70 lines (58 loc) · 2.22 KB
/
test-code.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
68
69
70
name: Test Code
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test-code:
runs-on: ubuntu-latest
env:
# Make sure CI fails on all warnings, including Clippy lints
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/shared
- name: Remove rust-toolchain.toml
# To make sure that the nightly version will be used all throughout
run: |
rm /home/runner/work/pendulum/pendulum/rust-toolchain.toml
- name: Setup nightly Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-05-30
components: rustfmt, clippy
target: wasm32-unknown-unknown
- name: Setup nightly Rust as default
run: rustup default nightly-2024-05-30
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Test
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: test
- name: Clippy -- Main
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: clippy
args: --all-features -- -W clippy::all -A clippy::style -A forgetting_copy_types -A forgetting_references
- name: Clippy -- All Targets (except integration)
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: clippy
# We are a bit more forgiving when it comes to the code in tests and only check for correctness
args: --workspace --all-features --all-targets --exclude runtime-integration-tests -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references
- name: Clippy -- Integration
uses: actions-rs/cargo@v1
with:
toolchain: nightly-2024-05-30
command: clippy
# We are a bit more forgiving when it comes to the code in tests and only check for correctness
args: --package runtime-integration-tests --all-features --all-targets -- -A clippy::all -W clippy::correctness -A forgetting_copy_types -A forgetting_references