-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 3.19 KB
/
Copy pathci.yml
File metadata and controls
107 lines (94 loc) · 3.19 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
name: CI
on:
workflow_dispatch:
push:
branches: [master]
pull_request:
branches: [master]
merge_group:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# fmt, clippy and build run on the dev toolchain, auto-installed by rustup
# from rust-toolchain.toml. Only the test matrix pins explicit versions.
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: cargo fmt --all --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features -- -D warnings
test:
needs: [fmt, clippy]
strategy:
fail-fast: false
matrix:
# Dev version (matches rust-toolchain.toml) plus the two below it.
# Raise this list and rust-toolchain.toml together by hand.
rust: ["stable", "beta", "1.95", "1.94"]
env:
- name: ubuntu
container: ""
- name: arch
container: "archlinux:latest"
name: test (${{ matrix.env.name }} / ${{ matrix.rust }})
runs-on: ubuntu-latest
# beta tracks the upcoming release; an upstream regression there must not
# block the merge queue. ci-success counts a continued job as success.
continue-on-error: ${{ matrix.rust == 'beta' }}
container: ${{ matrix.env.container }}
env:
RUSTUP_TOOLCHAIN: ${{ matrix.rust }}
steps:
- name: Prep (debian)
if: matrix.env.name == 'debian'
run: |
apt-get update
apt-get install -y --no-install-recommends \
git curl ca-certificates build-essential pkg-config libssl-dev
- name: Prep (arch)
if: matrix.env.name == 'arch'
run: |
pacman -Syu --noconfirm git curl base-devel openssl pkgconf
- uses: actions/checkout@v7
# Explicit per-version install: RUSTUP_TOOLCHAIN overrides
# rust-toolchain.toml, and the distro containers have no preinstalled Rust.
- uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # master, pinned 2026-03-27
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.env.name }}-${{ matrix.rust }}
- run: cargo test --all-features
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: Swatinem/rust-cache@v2
- run: cargo build --release
# Single stable status check for branch protection / merge queue. Matrix job
# names shift when the version list changes; this gate name does not.
ci-success:
name: CI success
if: ${{ always() }}
needs: [fmt, clippy, test, build]
runs-on: ubuntu-latest
steps:
- name: Check job results
run: |
for r in "${{ needs.fmt.result }}" "${{ needs.clippy.result }}" \
"${{ needs.test.result }}" "${{ needs.build.result }}"; do
case "$r" in
success | skipped) ;;
*) echo "required job result: $r"; exit 1 ;;
esac
done
echo "all required jobs succeeded or were skipped"