-
Notifications
You must be signed in to change notification settings - Fork 1
179 lines (155 loc) · 5.49 KB
/
Copy pathci.yml
File metadata and controls
179 lines (155 loc) · 5.49 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# +-------------------------------------------------------------------------
#
# taskmgr-rs - GitHub Actions 持续集成
#
# 文件: .github/workflows/ci.yml
#
# 日期: 2026年07月31日
# 环境: Windows 10 Pro Dev(Build 29634.1000)x86_64;Rust 1.97.0;MSVC 14.50.35729.0
# 作者: OpenAI Codex
# --------------------------------------------------------------------------
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: "0"
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
defaults:
run:
shell: pwsh
jobs:
quality:
name: Quality (x86_64)
runs-on: windows-2025-vs2026
timeout-minutes: 30
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install Rust toolchain
id: toolchain
run: |
rustup set profile minimal
rustup toolchain install stable `
--component rustfmt `
--component clippy `
--target x86_64-pc-windows-msvc
rustup show active-toolchain
$commit = @(
rustc -Vv |
Select-String '^commit-hash:' |
ForEach-Object { $_.Line.Split(':', 2)[1].Trim() }
)[0]
if ([string]::IsNullOrWhiteSpace($commit)) {
throw 'rustc did not report its commit hash'
}
"commit=$commit" | Out-File `
-FilePath $env:GITHUB_OUTPUT `
-Encoding utf8 `
-Append
- name: Restore Cargo cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-rust-quality-${{ steps.toolchain.outputs.commit }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml', '.cargo/config.toml') }}
restore-keys: |
${{ runner.os }}-rust-quality-${{ steps.toolchain.outputs.commit }}-
${{ runner.os }}-rust-quality-
- name: Check changed-line whitespace
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
if ([string]::IsNullOrWhiteSpace($env:BASE_SHA) -or $env:BASE_SHA -match '^0+$') {
git show --check --format= HEAD
} else {
git diff --check $env:BASE_SHA $env:GITHUB_SHA
}
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check all targets
run: cargo check --all-targets --locked
- name: Run strict Clippy
run: cargo clippy --all-targets --locked -- -D warnings
- name: Run all tests
run: cargo test --all-targets --locked
- name: Build release executable
run: cargo build --release --locked
architecture:
name: Architecture (${{ matrix.target }})
runs-on: windows-2025-vs2026
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- target: i686-pc-windows-msvc
run_tests: true
- target: aarch64-pc-windows-msvc
run_tests: false
steps:
- name: Checkout source
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
id: toolchain
run: |
rustup set profile minimal
rustup toolchain install stable `
--component clippy `
--target '${{ matrix.target }}'
rustup show active-toolchain
$commit = @(
rustc -Vv |
Select-String '^commit-hash:' |
ForEach-Object { $_.Line.Split(':', 2)[1].Trim() }
)[0]
if ([string]::IsNullOrWhiteSpace($commit)) {
throw 'rustc did not report its commit hash'
}
"commit=$commit" | Out-File `
-FilePath $env:GITHUB_OUTPUT `
-Encoding utf8 `
-Append
- name: Restore Cargo cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-rust-${{ matrix.target }}-${{ steps.toolchain.outputs.commit }}-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml', '.cargo/config.toml') }}
restore-keys: |
${{ runner.os }}-rust-${{ matrix.target }}-${{ steps.toolchain.outputs.commit }}-
${{ runner.os }}-rust-${{ matrix.target }}-
- name: Check all targets
run: cargo check --all-targets --target '${{ matrix.target }}' --locked
- name: Run strict Clippy
run: cargo clippy --all-targets --target '${{ matrix.target }}' --locked -- -D warnings
- name: Run executable tests
if: matrix.run_tests
run: cargo test --all-targets --target '${{ matrix.target }}' --locked
- name: Build release executable
run: cargo build --release --target '${{ matrix.target }}' --locked