-
Notifications
You must be signed in to change notification settings - Fork 42
304 lines (249 loc) · 8.37 KB
/
build.yml
File metadata and controls
304 lines (249 loc) · 8.37 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
name: Build and Test the Material
# Runs CI on pushing tags and pulls, but not both. Since we have branch protection on, these are our only cases to handle.
on:
push:
tags:
- "*"
pull_request:
env:
CARGO_TERM_COLOR: always # We want colors in our CI output
CARGO_INCREMENTAL: 0 # Don't waste time writing out incremental build files
CARGO_PROFILE_TEST_DEBUG: 0 # These are thrown away anyways, don't produce them
jobs:
render-material:
name: Render Material
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: mdbook@0.4.42,mdbook-graphviz@0.2.1
- name: Add mdslides
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrous-systems/mdslides/releases/download/v0.6.1/mdslides-installer.sh | sh
- name: Add graphviz
run: |
sudo apt-get update -y && sudo apt-get install -y graphviz
# A `minimal` profile saves a couple seconds from not downloading `clippy` or `rustdocs` and friends
- name: Update Rust
run: |
rustup set profile minimal
rustup update stable --no-self-update
- name: Find slug name
run: |
slug=$(./describe.sh "${GITHUB_REF}")
echo "Building with slug '${slug}'"
echo "slug=${slug}" >> "${GITHUB_ENV}"
- name: Execute
run: |
./localbuild.sh render-material
- name: Assemble Artifacts
run: |
echo "Making ./rust-training-${{ env.slug }}..."
mkdir -p ./rust-training-${{ env.slug }}
mv ./training-slides/slides ./rust-training-${{ env.slug }}/training-slides-presentation
mv ./training-slides/book ./rust-training-${{ env.slug }}/training-slides-book
cp -r ./example-code ./rust-training-${{ env.slug }}
echo "Compressing ./rust-training-${{ env.slug }}.zip..."
zip -r ./rust-training-${{ env.slug }}.zip ./rust-training-${{ env.slug }}
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: ${{success()}}
with:
name: Material
if-no-files-found: error
path: |
./rust-training-*/
- name: Create and Upload Release
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/')
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: ./rust-training-${{ env.slug }}.zip
test-cheatsheets:
name: Test Cheatsheets
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: xtask
- name: Execute
run: |
./localbuild.sh test-cheatsheets
ferrocene-qemu-aarch64v8a:
name: Build qemu-aarch64v8a with Ferrocene
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Critical Up
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrocene/criticalup/releases/download/v1.1.0/criticalup-installer.sh | sh
- name: Execute
env:
CRITICALUP_TOKEN: ${{ secrets.CRITICALUP_TOKEN }}
run: |
./localbuild.sh ferrocene-qemu-aarch64v8a
ferrocene-qemu-aarch32v8r:
name: Build qemu-aarch32v8r with Ferrocene
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Critical Up
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrocene/criticalup/releases/download/v1.1.0/criticalup-installer.sh | sh
- name: Execute
env:
CRITICALUP_TOKEN: ${{ secrets.CRITICALUP_TOKEN }}
run: |
./localbuild.sh ferrocene-qemu-aarch32v8r
ferrocene-qemu-thumbv7em:
name: Build qemu-thumbv7em with Ferrocene
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Critical Up
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ferrocene/criticalup/releases/download/v1.1.0/criticalup-installer.sh | sh
- name: Execute
env:
CRITICALUP_TOKEN: ${{ secrets.CRITICALUP_TOKEN }}
run: |
./localbuild.sh ferrocene-qemu-thumbv7em
eg-native-ffi-use-c-in-rust:
name: Build Example ffi-use-c-in-rust
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add Rust Targets and Tools
run: rustup set profile minimal
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: example-code/native/ffi/use-c-in-rust
- name: Execute
run: |
./localbuild.sh eg-native-ffi-use-c-in-rust
eg-native-ffi-use-rust-in-c:
name: Build Example ffi-use-rust-in-c
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add Rust Targets and Tools
run: rustup set profile minimal
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: example-code/native/ffi/use-rust-in-c
- name: Execute
run: |
./localbuild.sh eg-native-ffi-use-rust-in-c
eg-native-stdout:
name: Build Example native-stdout
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add Rust Targets and Tools
run: rustup set profile minimal
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: example-code/native/stdout
- name: Execute
run: |
./localbuild.sh eg-native-stdout
eg-nrf52-bsp-demo:
name: Build Example nrf52-bsp-demo
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add Rust Targets and Tools
run: |
rustup set profile minimal
rustup target add thumbv7em-none-eabihf
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: example-code/nrf52/bsp_demo
- name: Execute
run: |
./localbuild.sh eg-nrf52-bsp-demo
eg-qemu-aarch64v8a:
name: Build Example qemu-aarch64v8a
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add Rust Targets and Tools
run: |
rustup set profile minimal
rustup target add aarch64-unknown-none
rustup component add llvm-tools-preview
rustup component add rust-src
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: example-code/qemu-aarch64v8a
- name: Execute
run: |
./localbuild.sh eg-qemu-aarch64v8a
eg-qemu-aarch32v8r:
name: Build Example qemu-aarch32v8r
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add Rust Targets and Tools
run: |
rustup set profile minimal
rustup component add rust-src
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: example-code/qemu-aarch32v8r
- name: Execute
run: |
./localbuild.sh eg-qemu-aarch32v8r
eg-qemu-thumbv7em:
name: Build Example qemu-thumbv7em
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add Rust Targets and Tools
run: |
rustup set profile minimal
rustup target add thumbv7em-none-eabihf
- name: Set up cache
uses: Swatinem/rust-cache@v2
with:
workspaces: example-code/qemu-thumbv7em
- name: Execute
run: |
./localbuild.sh eg-qemu-thumbv7em
build-windows-examples:
name: Build Example ffi-use-rust-in-c on Windows
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Execute
run: |
cd example-code\native\ffi\use-rust-in-c\windows-example
msbuild.exe windows-example.sln /p:Configuration=Debug
.\x64\Debug\windows-example.exe
msbuild.exe windows-example.sln /p:Configuration=Release
.\x64\Release\windows-example.exe