Repository navigation
142 lines (133 loc) · 3.62 KB
/
Copy pathci.yaml
File metadata and controls
142 lines (133 loc) · 3.62 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# A little paranoia, but not excessive
name: CI
on:
push: # necessary for cache sharing
branches: [v0.1]
pull_request:
env:
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
jobs:
fmt:
name: cargo fmt
runs-on: ubuntu-latest
env:
RUST_NIGHTLY_PIN: nightly-2022-07-01 # upgrade this regularly
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust ${{env.RUST_NIGHTLY_PIN}}
uses: dtolnay/rust-toolchain@nightly
with:
toolchain: ${{env.RUST_NIGHTLY_PIN}}
components: rustfmt
- name: cargo fmt
run: cargo fmt -- --check
check:
name: cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
kind: check
- name: cargo check
run: cargo check --all-features --all-targets
clippy:
name: cargo clippy
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
kind: check
components: clippy
- name: cargo clippy
run: cargo clippy --all-features --all-targets -- -Dwarnings
test:
name: cargo test
needs: check
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{matrix.os}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: build
tools: nextest
- name: Build tests
run: cargo test --all-features --all-targets --no-run
- name: Run tests
run: cargo nextest run -P ci --all-features --all-targets --no-fail-fast
- name: Upload test report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v3
with:
name: junit-${{runner.os}}
path: target/nextest/ci/junit.xml
retention-days: 1
- name: Run doctests
run: cargo test --all-features --doc
wasi:
name: cargo wasi test
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: wasi-build
tools: wasmtime,cargo-wasi
- name: Refresh sh profile
run: source ~/.profile
- name: Build tests
run: cargo wasi test --all-features --all-targets --no-run
- name: Run tests
run: cargo wasi test --all-features --all-targets --no-fail-fast
hack:
name: cargo hack check --feature-powerset
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: check
- name: Check feature powerset
run: cargo hack check --feature-powerset --optional-deps --exclude-all-features --keep-going --lib --tests
msrv:
name: cargo msrv verify
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
id: setup
with:
kind: msrv
tools: cargo-msrv
- name: Install cargo-msrv
uses: taiki-e/install-action@v2
with:
tool: cargo-msrv
- name: Check msrv
run: cargo msrv verify