-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (110 loc) · 3.59 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
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
name: Continuous integration
on:
pull_request:
push:
jobs:
# The complete workspace only needs to be compiled for linux x86
check-stable-all:
name: "Check & Build"
uses: ./.github/workflows/mixin-cargo-check.yml
with:
os: ubuntu-latest
rust-version: stable
# This one is optional, but it is nice to know if something will work as intended in the future
check-nightly:
name: "Check & Build (Nightly)"
uses: ./.github/workflows/mixin-cargo-check.yml
with:
os: ubuntu-latest
rust-version: nightly
test:
needs: check-stable-all
name: "Tests"
# TODO: Run on macOS and windows as well using matrix (if this provides any value)
uses: ./.github/workflows/mixin-cargo-test.yml
with:
os: ubuntu-latest
rust-version: stable
clippy:
needs: check-stable-all
name: "Clippy (Stable)"
# NOTE: Maybe we should run this on macOS and windows, not sure if it is worth it
uses: ./.github/workflows/mixin-cargo-clippy.yml
with:
os: ubuntu-latest
rust-version: stable
# We use the nightly formatter because it has additional formatter settings
fmt:
# Note that we don't depend on check in stable or nightly
# as code need not compile for the formatter to work
name: "Formatter"
uses: ./.github/workflows/mixin-cargo-fmt.yml
with:
os: ubuntu-latest
rust-version: nightly
doc:
# Note that we don't depend on check in stable or nightly
# as code need not compile for the formatter to work
name: "Documentation"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: "Compile documentation"
run: cargo doc --workspace --no-deps --all-features
- name: "Run doc tests"
run: cargo test --workspace --doc
# Clippy contains more lints in nightly, they might be unstable / unusable, but show them regardless
clippy-nightly:
needs: check-nightly
name: "Clippy (Nightly)"
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy
- name: Run unit tests
run: cargo clippy --workspace
audit:
# needs: check-stable-all
name: "Audit"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
direct-minimal-versions:
name: "Direct Minimal versions"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- name: Run direct minimal versions
run: cargo minimal-versions check --workspace --direct
msrv:
# Lets first make sure it works with the most recent version before we attempt all supported versions
needs: check-stable-all
name: "Minimum supported rust version"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cargo-bins/cargo-binstall@main
- name: Install Cargo MSRV
run: cargo binstall --no-confirm cargo-msrv
- name: "Run minimum supported rust version"
run: cargo msrv