-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.4 KB
/
Copy pathrust.yml
File metadata and controls
46 lines (40 loc) · 1.4 KB
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
name: CI
# Runs the same checks that release.yml gates on, so a red release is caught
# on the pull request rather than at tag time.
on:
push:
branches: ["master"]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: rustup toolchain install stable --profile minimal --component rustfmt,clippy
- name: Check formatting
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --all-targets --locked -- -D warnings
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- run: rustup toolchain install stable --profile minimal
# --locked so a stale Cargo.lock fails here instead of during a release.
- run: cargo test --locked
# Verifies the `rust-version` promised in Cargo.toml is actually buildable.
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Read rust-version from Cargo.toml
id: msrv
run: echo "version=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].rust_version')" >> "$GITHUB_OUTPUT"
- run: rustup toolchain install ${{ steps.msrv.outputs.version }} --profile minimal
- run: cargo +${{ steps.msrv.outputs.version }} check --locked