-
Notifications
You must be signed in to change notification settings - Fork 80
101 lines (87 loc) · 2.39 KB
/
rust.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
name: CI
env:
CARGO_TERM_VERBOSE: true
RUSTDOCFLAGS: -Dwarnings
RUSTFLAGS: -Dwarnings
on:
pull_request:
push:
branches:
- master
jobs:
test:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
channel:
- stable
- nightly
- 1.63.0 # MSRV of test dependencies
os:
- macos-13 # x86 MacOS
- macos-15 # Arm MacOS
- windows-2025
- ubuntu-24.04
include:
- channel: beta
os: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update rust
run: |
rustup default ${{ matrix.channel }}
rustup update --no-self-update
- run: cargo test --all
clippy:
name: Clippy
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update rust
run: |
# use beta since it gives us near-latest fixes but isn't as volatile as nightly
rustup default beta
rustup component add clippy
rustup update --no-self-update
# FIXME(msrv): suggestions do not work in 1.23, nor dows `#![allow(clippy::...)]`
- run: cargo clippy --all -- -Aclippy::while_let_loop
msrv:
name: Check building with the MSRV
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update rust
run: |
rustup default 1.23.0
rustup update --no-self-update
- run: cargo build
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
run: |
rustup default nightly
rustup update --no-self-update
rustup component add rustfmt
- run: cargo fmt -- --check
success:
needs:
- test
- clippy
- msrv
- rustfmt
runs-on: ubuntu-latest
# GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency
# failed" as success. So we have to do some contortions to ensure the job fails if any of its
# dependencies fails.
if: always() # make sure this is never "skipped"
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: check if any dependency failed
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'