-
Notifications
You must be signed in to change notification settings - Fork 13
95 lines (73 loc) · 1.99 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: build
on:
pull_request:
push:
branches:
- master
env:
CARGO_TERM_COLOR: always
FORCE_COLOR: 3
RUSTFLAGS: -D warnings
jobs:
build:
name: Build
strategy:
matrix:
rust:
- stable
- nightly
os:
- ubuntu-latest
- windows-latest
exclude:
- rust: nightly
os: windows-latest
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install ${{ matrix.rust }} Rust
run: rustup default ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test
# This checks examples and benchmarks, which are not covered above.
- name: Check all targets
if: matrix.rust == 'nightly'
run: cargo check --all-targets
msrv:
name: Build MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Detect MSRV
run: echo MSRV=$(grep 'rust-version' Cargo.toml | cut -d '"' -f 2) >> "$GITHUB_ENV"
- name: Install Rust ${{ env.MSRV }}
run: rustup default $MSRV
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build
build-documentation:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build documentation and check intra-doc links
env:
RUSTDOCFLAGS: --deny rustdoc::broken_intra_doc_links
run: cargo doc --no-deps
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Clippy with default lints
run: cargo clippy
- name: Lint for left-over debug prints
run: cargo clippy -- -D clippy::print_stdout -D clippy::print_stderr