forked from tock/tock
-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (187 loc) · 7.03 KB
/
ci.yml
File metadata and controls
208 lines (187 loc) · 7.03 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# Licensed under the Apache License, Version 2.0 or the MIT License.
# SPDX-License-Identifier: Apache-2.0 OR MIT
# Copyright Tock Contributors 2023.
# This workflow contains all tock-ci, separated into jobs
name: tock-ci
env:
TERM: xterm # Makes tput work in actions output
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push: # Run CI for all branches except GitHub merge queue tmp branches
branches-ignore:
- "gh-readonly-queue/**"
pull_request: # Run CI for PRs on any branch
merge_group: # Run CI for the GitHub merge queue
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
# If you add additional jobs, remember to add them to bors.toml
permissions:
contents: read
jobs:
ci-format:
strategy:
matrix:
os: [ubuntu-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: ci-job-format
run: make ci-job-format
- name: ci-job-markdown-toc
run: make ci-job-markdown-toc
- name: ci-job-readme-check
run: make ci-job-readme-check
ci-clippy:
strategy:
matrix:
os: [ubuntu-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
- name: ci-job-clippy
run: make ci-job-clippy
ci-build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Check that `Cargo.lock` is current
run: |
if ! cargo check --locked; then
echo
echo "Running \"cargo check\" to compute lockfile diff..."
echo
cp Cargo.lock /tmp/Cargo.lock.orig
cargo check -q
echo
# Essentially there's two ways in which the Cargo.lock
# could be out-of-sync:
#
# - It plainly doesn't correspond to the git ref that was pushed to
# CI. This can happen when updating dependencies or the set of
# crates in the workspace, but not checking in the updated
# Cargo.lock. Then the remedy is simple: run a command like `cargo
# check` to update the lockfile, and check it into git.
#
# - It does correspond to the git ref that was pushed to CI.
# However, for GH Actions run in response to the `pull_request`
# event, GitHub doesn't build the pushed ref -- it instead builds
# the merged result of the pushed ref merged into current target
# branch revision (e.g., master).
#
# This can potentially result in conflicts: for instance, if two
# crates rely on different versions of a common sub-dependency,
# but the git merge algorithm were to simply include both
# instances in the lockfile, then this needs to be resolved by
# rebasing on the target branch, and manually fixing the lockfile
# (either using cargo check or editing it).
#
# The latter case is probably less likely to cause issues, but also
# more confusing to users. So we want to provide universal guidance
# that always works for these kinds of errors: when in doubt, simply
# rebase and run cargo check, and check in the resulting lockfile.
if [[ -v GITHUB_BASE_REF ]]; then
# This is a pull request, building against the merged ref:
echo \
"The Cargo.lock lockfile needs to be updated before this pull"\
"request can be merged. You can do so by rebasing on this PR's"\
"target branch (\"$GITHUB_BASE_REF\"), and then running a"\
"command like \"cargo check\" or \"cargo build\" locally."\
"Below is the diff that a \"cargo check\" command attempts to"\
"make:"
else
# This is not a pull request, building against the ref pushed by
# the developer:
echo \
"The Cargo.lock lockfile does not match this tree. You can fix"\
"this issue by running a command like \"cargo check\" or"\
"\"cargo build\" locally, and then committing the updated"\
"Cargo.lock lockfile."
fi
echo
diff /tmp/Cargo.lock.orig Cargo.lock
exit 1
fi
- name: ci-job-syntax
run: make ci-job-syntax
- name: ci-job-compilation
run: make ci-job-compilation
- name: ci-job-msrv
run: make ci-job-msrv
- name: ci-job-debug-support-targets
run: make ci-job-debug-support-targets
- name: ci-job-collect-artifacts
run: make ci-job-collect-artifacts
- name: upload-build-artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: tools/ci/ci-artifacts
ci-tests:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Update package repositories
run: |
sudo apt update
if: matrix.os == 'ubuntu-latest'
- name: Install dependencies for ubuntu-latest
run: |
sudo apt install -q libudev-dev libzmq3-dev
if: matrix.os == 'ubuntu-latest'
- uses: actions/checkout@v4
- name: ci-job-libraries
run: make ci-job-libraries
- name: ci-job-archs
run: make ci-job-archs
- name: ci-job-kernel
run: make ci-job-kernel
- name: ci-job-capsules
run: make ci-job-capsules
- name: ci-job-chips
run: make ci-job-chips
- name: ci-job-tools
run: make ci-job-tools
- name: ci-job-cargo-test-build
run: make ci-job-cargo-test-build
ci-flux:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Update package repositories
run: |
sudo apt update
- name: Install dependencies
continue-on-error: true
run: |
sudo apt install -q z3
- uses: actions/checkout@v4
- name: ci-job-flux
run: make ci-job-flux
ci-qemu:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Update package repositories
run: |
sudo apt update
- name: Install dependencies
continue-on-error: true
run: |
sudo apt install -q meson libglib2.0-dev
- uses: actions/checkout@v4
- name: ci-job-qemu
run: make ci-job-qemu