-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (39 loc) · 1.17 KB
/
build-check.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
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set rust version
run: |
source ci/rust-version.sh
echo "RUST_STABLE=$rust_stable" | tee -a $GITHUB_ENV
# The toolchain action should definitely be run before the cache action
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_STABLE }}
components: rustfmt, clippy
cache: false
# avoid the default "-D warnings" which thrashes cache
rustflags: ""
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run fmt+clippy
run: |
cargo fmt --all --check
cargo clippy --workspace --all-targets
- name: Build
run: |
cargo build --all-targets