-
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (94 loc) · 3.39 KB
/
ci.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
96
97
98
99
100
101
102
# Largely inspired by https://github.com/dtolnay/syn/blob/master/.github/workflows/ci.yml under MIT OR Apache-2.0.
name: CI
permissions:
contents: read
on:
pull_request:
push:
# This used to also be scheduled, but apparently GitHub also turns it off otherwise when deactivating that due to repository inactivity.
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
- run: cat CI.toml >> Cargo.toml
- run: cargo test --workspace --locked --no-default-features
- run: cargo test --workspace --locked
- run: cargo test --workspace --locked --all-features
# Test the main crate separately, since the examples pull in features.
- run: cargo test --locked --no-default-features
- run: cargo test --locked
- run: cargo test --locked --all-features
browser-test:
name: Browser Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
with:
toolchain: stable
profile: minimal
target: wasm32-unknown-unknown
- run: cargo +stable install wasm-bindgen-cli --vers "^0.2.71"
- run: cat CI.toml >> Cargo.toml
- run: cargo +stable test --locked --target wasm32-unknown-unknown --no-default-features
- run: cargo +stable test --locked --target wasm32-unknown-unknown
- run: cargo +stable test --locked --target wasm32-unknown-unknown --all-features
miri:
name: Miri
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
with:
toolchain: nightly
profile: minimal
components: miri, rust-src
- run: cat CI.toml >> Cargo.toml
- run: cargo +nightly miri test --workspace --locked --no-default-features
- run: cargo +nightly miri test --workspace --locked
- run: cargo +nightly miri test --workspace --locked --all-features
check:
name: Check on Rust ${{matrix.rust}}${{format(' ({0})', matrix.target || matrix.os)}}
runs-on: ${{matrix.os}}-latest
strategy:
matrix:
os: [macos, ubuntu, windows]
rust: ['1.58', stable, beta, nightly]
env:
target: ${{matrix.target && format('--target={0}', matrix.target)}}
workspace: ${{matrix.no-workspace || '--workspace'}}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
with:
toolchain: ${{matrix.rust}}
profile: minimal
target: ${{matrix.target}}
- run: cat CI.toml >> Cargo.toml
- run: cargo +${{matrix.rust}} check --locked ${{env.target}} ${{env.workspace}} --no-default-features
- run: cargo +${{matrix.rust}} check --locked ${{env.target}} ${{env.workspace}}
- run: cargo +${{matrix.rust}} check --locked ${{env.target}} ${{env.workspace}} --all-features
minimal-versions:
name: Minimal Versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/[email protected]
with:
toolchain: nightly
override: true
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- run: cat CI.toml >> Cargo.toml
- run: cargo minimal-versions check --workspace
book:
name: Book
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- run: cat CI.toml >> Cargo.toml
- run: cd book && cargo run