-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (85 loc) · 3.14 KB
/
Copy pathci.yml
File metadata and controls
109 lines (85 loc) · 3.14 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
# CI gate for deep-code
#
# 触发:push 到 main、以及所有 pull request
# 检查:rustfmt 格式、clippy(-D warnings)、全 workspace 测试
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: fmt · clippy · test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
# Pinned to match rust-toolchain.toml; bump both together.
uses: dtolnay/rust-toolchain@1.96.0
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy (deny warnings)
run: cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Test
run: cargo test --locked --workspace
# Compiles & tests the macOS-only Seatbelt code. These tests actually spawn
# `sandbox-exec`, so this job is the only place the real profile is enforced
# end to end — the other two jobs `cfg`-skip all of it. macOS is also the
# primary development and release platform.
macos:
name: macos · clippy · test
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
# Pinned to match rust-toolchain.toml; bump both together.
uses: dtolnay/rust-toolchain@1.96.0
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy (deny warnings)
run: cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Test
run: cargo test --locked --workspace
# Runs on the exact runner label the release workflow builds linux-arm64 on.
# Release is tag-triggered only, so without this job that label would first
# be exercised *after* the tag is pushed — and an invalid label does not
# fail, it queues forever. This also covers aarch64 (Landlock/seccomp) with
# real tests, which no other job does. Free for public repos.
linux-arm:
name: linux-arm · clippy · test
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
# Pinned to match rust-toolchain.toml; bump both together.
uses: dtolnay/rust-toolchain@1.96.0
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy (deny warnings)
run: cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Test
run: cargo test --locked --workspace
# Compiles & tests the Windows-only sandbox (Job Object) code, which the
# Linux job's `cfg(windows)` gating skips.
windows:
name: windows · clippy · test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
# Pinned to match rust-toolchain.toml; bump both together.
uses: dtolnay/rust-toolchain@1.96.0
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy (deny warnings)
run: cargo clippy --locked --workspace --all-targets -- -D warnings
- name: Test
run: cargo test --locked --workspace