-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.76 KB
/
build-and-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
51
52
53
54
55
56
57
58
59
60
61
62
63
---
name: Build and test
on:
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: --deny warnings
jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Keep MSRV in sync with rust-version in Cargo.toml
rust: [stable, beta, nightly, 1.79.0]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #v1.0.7
with:
toolchain: ${{ matrix.rust }}
profile: minimal
default: true
- name: Build
run: cargo build --all-targets --locked
- name: Test
run: cargo test --locked
# Make sure documentation builds without warnings (broken links etc)
- name: Generate documentation
if: matrix.rust == 'stable'
run: RUSTDOCFLAGS="--deny warnings" cargo doc
# Make sure the library builds with all dependencies downgraded to their
# oldest versions allowed by the semver spec. This ensures we have not
# under-specified any dependency
minimal-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #v1.0.7
with:
toolchain: stable
profile: minimal
- name: Install nightly Rust
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #v1.0.7
with:
toolchain: nightly
profile: minimal
- name: Downgrade dependencies to minimal versions
run: cargo +nightly update -Z minimal-versions
- name: Compile with minimal versions
run: cargo +stable build --all-targets --locked