-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (43 loc) · 1.25 KB
/
rust.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
name: Tests
on: [push, pull_request]
jobs:
test:
name: Test Workspace on AMD64 Rust ${{ matrix.rust }}
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64]
rust: [stable]
container:
image: ${{ matrix.arch }}/rust
env:
# Disable full debug symbol generation to speed up CI build and keep memory down
# "1" means line tables only, which is useful for panic tracebacks.
RUSTFLAGS: "-C debuginfo=1"
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v4
with:
path: /home/runner/.cargo
key: cargo-cache-
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: /home/runner/target
key: target-cache-
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt
rustup component add clippy
- name: Run tests
run: |
cargo test
- name: Run format
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --workspace -- -D warnings