Debian Codegraph @

.github/workflows/ci.yml

raw symbols SCIP
1 name: ci
2
3 on:
4 push:
5 branches:
6 - master
7 pull_request:
8
9 # Cancel redundant workflows on the same branch/PR
10 concurrency:
11 group: ci-${{ github.ref }}
12 cancel-in-progress: true
13
14 jobs:
15 fmt:
16 name: Rustfmt
17 runs-on: ubuntu-latest
18 steps:
19 - uses: actions/checkout@v3
20
21 - name: Install toolchain (stable) + rustfmt
22 uses: dtolnay/rust-toolchain@stable
23 with:
24 components: rustfmt
25
26 - uses: Swatinem/rust-cache@v2
27
28 - name: Check formatting
29 run: cargo fmt --all -- --check
30
31 clippy:
32 name: Clippy
33 needs: fmt
34 runs-on: ubuntu-latest
35 steps:
36 - uses: actions/checkout@v3
37
38 - name: Install toolchain (stable) + clippy
39 uses: dtolnay/rust-toolchain@stable
40 with:
41 components: clippy
42
43 - uses: Swatinem/rust-cache@v2
44
45 - name: Run clippy
46 run: cargo clippy --all-features -- -D warnings
47
48 build:
49 name: Build (${{ matrix.build_type }})
50 needs: clippy
51 runs-on: ubuntu-latest
52 strategy:
53 matrix:
54 include:
55 - build_type: debug
56 cargo_profile: dev
57 - build_type: release
58 cargo_profile: release
59 steps:
60 - uses: actions/checkout@v3
61
62 - name: Install toolchain (stable)
63 uses: dtolnay/rust-toolchain@stable
64
65 - uses: Swatinem/rust-cache@v2
66
67 - name: cargo build
68 run: cargo build --profile ${{ matrix.cargo_profile }} --all-features
69
70 test:
71 name: Test
72 needs: build
73 runs-on: ubuntu-latest
74 steps:
75 - uses: actions/checkout@v3
76
77 - name: Install toolchain (stable)
78 uses: dtolnay/rust-toolchain@stable
79
80 - uses: Swatinem/rust-cache@v2
81
82 - name: Run tests
83 run: cargo test --all-features
84
85 msrv:
86 name: MSRV (${{ matrix.build_type }})
87 needs: build
88 runs-on: ubuntu-latest
89 env:
90 MSRV: "1.70.0" # if you change it, remember to change it also in Cargo.toml
91 strategy:
92 matrix:
93 include:
94 - build_type: debug
95 cargo_profile: dev
96 - build_type: release
97 cargo_profile: release
98 steps:
99 - uses: actions/checkout@v3
100
101 - name: Install toolchain (MSRV)
102 uses: dtolnay/rust-toolchain@master
103 with:
104 toolchain: ${{ env.MSRV }}
105
106 - uses: Swatinem/rust-cache@v2
107 with:
108 shared-key: "rust-msrv"
109
110 - name: cargo build
111 run: cargo build --profile ${{ matrix.cargo_profile }} --all-features --locked