Debian Codegraph @

.github/workflows/rust.yml

raw symbols SCIP
1 ---
2 name: Rust
3 on:
4 push:
5 branches: [ master ]
6 pull_request:
7 branches: [ master ]
8
9 env:
10 CARGO_TERM_COLOR: always
11 # Pinned toolchain for linting
12 ACTION_LINTS_TOOLCHAIN: 1.85.0
13
14 jobs:
15 tests-stable:
16 name: "Tests, stable toolchain"
17 runs-on: ubuntu-latest
18 steps:
19 - name: Checkout repository
20 uses: actions/checkout@v2
21 - name: Install toolchain
22 uses: actions-rs/toolchain@v1
23 with:
24 toolchain: "stable"
25 default: true
26 - name: cargo build --all-features
27 run: cargo build --all-features
28 - name: cargo test --all-features
29 run: cargo test --all-features
30 tests-release-stable:
31 name: "Tests (release), stable toolchain"
32 runs-on: ubuntu-latest
33 steps:
34 - name: Checkout repository
35 uses: actions/checkout@v2
36 - name: Install toolchain
37 uses: actions-rs/toolchain@v1
38 with:
39 toolchain: "stable"
40 default: true
41 - name: cargo build (release)
42 run: cargo build --release
43 - name: cargo test (release)
44 run: cargo test --release
45 tests-release-msrv:
46 name: "Tests (release), minimum supported toolchain"
47 runs-on: ubuntu-latest
48 steps:
49 - name: Checkout repository
50 uses: actions/checkout@v2
51 - name: Extract MSRV
52 run: echo "ACTION_MSRV_TOOLCHAIN=$(grep 'rust-version' Cargo.toml | cut -d '"' -f2)" >> $GITHUB_ENV
53 - name: Install toolchain
54 uses: actions-rs/toolchain@v1
55 with:
56 toolchain: ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
57 default: true
58 - name: cargo build (release)
59 run: cargo build --release
60 - name: cargo test (release)
61 run: cargo test --release
62 linting:
63 name: "Lints, pinned toolchain"
64 runs-on: ubuntu-latest
65 steps:
66 - name: Checkout repository
67 uses: actions/checkout@v2
68 - name: Install toolchain
69 uses: actions-rs/toolchain@v1
70 with:
71 toolchain: ${{ env['ACTION_LINTS_TOOLCHAIN'] }}
72 default: true
73 components: rustfmt, clippy
74 - name: cargo clippy (warnings)
75 run: cargo clippy -- -D warnings
76 - name: cargo fmt (check)
77 run: cargo fmt -- --check -l
78 tests-other-channels:
79 name: "Tests, unstable toolchain"
80 runs-on: ubuntu-latest
81 continue-on-error: true
82 strategy:
83 matrix:
84 channel:
85 - "beta"
86 - "nightly"
87 steps:
88 - name: Checkout repository
89 uses: actions/checkout@v2
90 - name: Install toolchain
91 uses: actions-rs/toolchain@v1
92 with:
93 toolchain: ${{ matrix.channel }}
94 default: true
95 - name: cargo build
96 run: cargo build
97 - name: cargo test
98 run: cargo test