-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (75 loc) · 2.32 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
# Largely inspired by https://github.com/dtolnay/syn/blob/master/.github/workflows/ci.yml under MIT OR Apache-2.0.
name: CI
on:
pull_request:
push:
schedule: [cron: "0 8 * * 5"] # 8:00 on Fridays
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- run: cat CI.toml >> Cargo.toml
- run: cargo test --workspace --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.40.0, stable, beta, nightly]
include:
- os: ubuntu
target: wasm32-unknown-unknown
no-workspace: --lib
env:
target: ${{matrix.target && format('--target={0}', matrix.target)}}
workspace: ${{matrix.no-workspace || '--workspace'}}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.rust}}
profile: minimal
target: ${{matrix.target}}
- run: cat CI.toml >> Cargo.toml
- run: cargo +${{matrix.rust}} check ${{env.target}} ${{env.workspace}} --no-default-features
- run: cargo +${{matrix.rust}} check ${{env.target}} ${{env.workspace}}
- run: cargo +${{matrix.rust}} check ${{env.target}} ${{env.workspace}} --all-features
minimal-versions:
name: Minimal Versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- run: cat CI.toml >> Cargo.toml
- run: cargo +nightly update -Z minimal-versions
- run: cargo +nightly check --lib --all-features
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: clippy
- run: cat CI.toml >> Cargo.toml
- run: cargo +nightly clippy --workspace --all-features
fmt:
name: Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
- run: cat CI.toml >> Cargo.toml
- run: cargo +nightly fmt --all -- --check