-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (55 loc) · 1.32 KB
/
build.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
51
52
53
54
55
56
57
58
name: Build
on:
push:
branches:
- '*'
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
msrv: ${{ steps.get-msrv.outputs.msrv }}
steps:
- uses: actions/checkout@v4
- name: Get MSRV
id: get-msrv
run: |
MSRV=$(grep '^rust-version' Cargo.toml | cut -d '"' -f 2)
echo "msrv=$MSRV" >> $GITHUB_OUTPUT
build:
needs: prepare
strategy:
matrix:
versions:
- stable
- ${{ needs.prepare.outputs.msrv }}
os:
- ubuntu-24.04
- macos-14
- windows-2022
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.versions }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Version
run: |
rustc --version
cargo --version
cargo fmt -- --version
cargo clippy -- --version
- name: Format
run: cargo fmt --all -- --check
- name: Build
run: cargo build --verbose
- name: Lint
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --verbose