-
Notifications
You must be signed in to change notification settings - Fork 8
50 lines (46 loc) · 1.38 KB
/
test.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
name: Test
on:
push:
# Don't build tags; that's redundant with pushes to main normally.
tags-ignore: "*"
# Only build main, for all other branches rely on pull requests. This
# avoids duplicate builds for pull requests.
branches: main
# Don't build for trivial changes
paths-ignore:
- "*.md"
- "LICENSE*"
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Test against MRSV and stable
rust: ["1.66.0", "stable"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: clippy,rustfmt
toolchain: ${{ matrix.rust }}
- run: cargo build --all-targets --locked
- run: cargo clippy --all-targets --locked
# Run clippy only on stable target; we don't need lints from old Rust
# versions.
if: "${{ matrix.rust == 'stable' }}"
- run: cargo test --locked
- run: cargo doc
- run: cargo fmt -- --check
# Run fmt check only on stable rust, as our reference.
if: "${{ matrix.rust == 'stable' }}"
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
semver-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: obi1kenobi/cargo-semver-checks-action@v2