forked from seL4/microkit
-
Notifications
You must be signed in to change notification settings - Fork 0
251 lines (238 loc) · 8.48 KB
/
Copy pathdeploy.yml
File metadata and controls
251 lines (238 loc) · 8.48 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
# Copyright 2021, Proofcraft Pty Ltd
# Copyright 2026, UNSW
#
# SPDX-License-Identifier: BSD-2-Clause
# Deploy default.xml to microkit-manifest after successful runs.
name: Deploy
on:
push:
branches: [main]
paths-ignore:
- '**.md'
# allow manual trigger
workflow_dispatch:
# allow explicit trigger from other repos when dependencies have changed
repository_dispatch:
types: [deps-update]
jobs:
code:
name: Freeze Code
runs-on: ubuntu-latest
outputs:
xml: ${{ steps.repo.outputs.xml }}
steps:
- id: repo
uses: seL4/ci-actions/repo-checkout@master
with:
manifest_repo: seL4/microkit-manifest
manifest_branch: main
manifest: main.xml
# TODO: We want to add support for this but have yet to do so.
# sim:
# name: Simulation
# needs: code
# runs-on: ubuntu-latest
# strategy:
# matrix:
# march: [aarch64, x86_64, riscv64]
# compiler: [gcc]
# steps:
# - uses: seL4/ci-actions/microkit-sim@master
# with:
# xml: ${{ needs.code.outputs.xml }}
# march: ${{ matrix.march }}
# compiler: ${{ matrix.compiler }}
sdk-build:
name: Build SDK (macOS, all targets)
needs: code
runs-on: [self-hosted, macos, ARM64]
outputs:
SDK_VERSION: ${{ steps.version.outputs.SDK_VERSION }}
steps:
- name: Clean build
run: |
rm -rf "$GITHUB_WORKSPACE"
mkdir -p "$GITHUB_WORKSPACE"
- name: Checkout code
uses: seL4/ci-actions/repo-checkout@master
with:
xml: ${{ needs.code.outputs.xml }}
# needed for reasons...
manifest_repo: seL4/microkit-manifest
manifest_branch: main
manifest_depth: 0
manifest: main.xml
- name: Set version
id: version
run: ./ci/sdk_version.sh
working-directory: ./microkit/
- name: Get Nix dependencies
run: nix develop -c bash -c 'echo Hello World'
working-directory: ./microkit/
- name: Build SDK
run: nix develop --ignore-environment -c bash -c "python3 build_sdk.py --sel4=../seL4 --version ${{ env.SDK_VERSION }} --gcc-toolchain-prefix-x86_64 x86_64-elf --gcc-toolchain-prefix-riscv64 riscv64-none-elf --release-packaging"
working-directory: ./microkit/
- name: Upload SDK (macos-aarch64)
uses: actions/upload-artifact@v7
with:
name: microkit-sdk-${{ env.SDK_VERSION }}-macos-aarch64
path: microkit/release/microkit-sdk-${{ env.SDK_VERSION }}-macos-aarch64.tar.gz
- name: Upload SDK (macos-x86-64)
uses: actions/upload-artifact@v7
with:
name: microkit-sdk-${{ env.SDK_VERSION }}-macos-x86-64
path: microkit/release/microkit-sdk-${{ env.SDK_VERSION }}-macos-x86-64.tar.gz
- name: Upload SDK (linux-aarch64)
uses: actions/upload-artifact@v7
with:
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-aarch64
path: microkit/release/microkit-sdk-${{ env.SDK_VERSION }}-linux-aarch64.tar.gz
- name: Upload SDK (linux-x86-64)
uses: actions/upload-artifact@v7
with:
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64
path: microkit/release/microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64.tar.gz
# Not used for HW Run, just to confirm it builds on Linux outside of Nix.
sdk-build-linux:
name: Build SDK (Linux x86_64)
runs-on: ubuntu-24.04
needs: code
steps:
- name: Checkout code
uses: seL4/ci-actions/repo-checkout@master
with:
xml: ${{ needs.code.outputs.xml }}
# needed for reasons...
manifest_repo: seL4/microkit-manifest
manifest_branch: main
manifest_depth: 0
manifest: main.xml
- name: Set version
run: ./ci/sdk_version.sh
working-directory: ./microkit/
- name: Install SDK dependencies
run: ./ci/install_ubuntu_deps.sh
working-directory: ./microkit/
- name: Build SDK (x86-64)
run: ./pyenv/bin/python build_sdk.py --sel4=../seL4 --version ${{ env.SDK_VERSION }}-linux-x86-64 --tool-target-triple="x86_64-unknown-linux-musl"
working-directory: ./microkit/
the_matrix:
name: Matrix
needs: sdk-build
runs-on: ubuntu-latest
outputs:
gh_matrix: ${{ steps.matrix.outputs.gh_matrix }}
test_cases: ${{ steps.matrix.outputs.test_cases }}
steps:
- name: Checkout code
uses: seL4/ci-actions/repo-checkout@master
with:
xml: ${{ needs.code.outputs.xml }}
# needed for reasons...
manifest_repo: seL4/microkit-manifest
manifest_branch: main
manifest: main.xml
- id: matrix
uses: seL4/ci-actions/microkit-hw-matrix@master
env:
# We don't actually care what this is set to, but for the files for
# each platform it expects this path to exist, so we set it up.
MICROKIT_SDK: /dummy-microkit-sdk-for-matrix
hw-build:
name: HW Test Builds
if: ${{ github.repository_owner == 'seL4' }}
runs-on: ubuntu-latest
# FIXME: Add simulation support
# needs: [sim, the_matrix, sdk-build]
needs: [the_matrix, sdk-build]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.the_matrix.outputs.gh_matrix) }}
env:
SDK_VERSION: ${{ needs.sdk-build.outputs.SDK_VERSION }}
steps:
- name: Checkout code
uses: seL4/ci-actions/repo-checkout@master
with:
xml: ${{ needs.code.outputs.xml }}
# needed for reasons...
manifest_repo: seL4/microkit-manifest
manifest_branch: main
manifest: main.xml
- name: Download microkit SDK
uses: actions/download-artifact@v8
with:
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64
- name: Extract microkit SDK
run: |
tar xzf ./microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64.tar.gz
export "MICROKIT_SDK=$(realpath ./microkit-sdk-${{ env.SDK_VERSION }}/)"
echo "MICROKIT_SDK=${MICROKIT_SDK}" >> "${GITHUB_ENV}"
- name: Install build dependencies
run: ./ci/install_march_build_deps.sh ${{ matrix.march }}
working-directory: ./microkit/
- name: Build
uses: seL4/ci-actions/microkit-hw-build@master
with:
board: ${{ matrix.board }}
env:
TEST_CASES: ${{ needs.the_matrix.outputs.test_cases }}
- name: Upload test case builds
uses: actions/upload-artifact@v7
with:
name: loader-img-${{ matrix.board }}
path: '*.loader.img'
hw-run:
name: HW Run
if: ${{ github.repository_owner == 'seL4' }}
runs-on: ubuntu-latest
needs: [the_matrix, hw-build, sdk-build]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.the_matrix.outputs.gh_matrix) }}
# do not run concurrently with other workflows, but do run concurrently in the build matrix
concurrency: hw-run-${{ strategy.job-index }}
env:
SDK_VERSION: ${{ needs.sdk-build.outputs.SDK_VERSION }}
steps:
- name: Get machine queue
uses: actions/checkout@v6
with:
repository: seL4/machine_queue
path: machine_queue
- name: Download test cases builds
uses: actions/download-artifact@v8
with:
name: loader-img-${{ matrix.board }}
- name: Download microkit SDK
uses: actions/download-artifact@v8
with:
name: microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64
- name: Extract microkit SDK
run: |
tar xzf ./microkit-sdk-${{ env.SDK_VERSION }}-linux-x86-64.tar.gz
export "MICROKIT_SDK=$(realpath ./microkit-sdk-${{ env.SDK_VERSION }}/)"
echo "MICROKIT_SDK=${MICROKIT_SDK}" >> "${GITHUB_ENV}"
- name: Run
uses: seL4/ci-actions/microkit-hw-run@master
with:
board: ${{ matrix.board }}
index: ${{ strategy.job-index }}
env:
TEST_CASES: ${{ needs.the_matrix.outputs.test_cases }}
HW_SSH: ${{ secrets.HW_SSH }}
deploy:
name: Deploy manifest
if: ${{ github.repository_owner == 'seL4' }}
runs-on: ubuntu-24.04
needs: [code, hw-run, sdk-build-linux]
steps:
- name: Deploy
uses: seL4/ci-actions/manifest-deploy@master
with:
xml: ${{ needs.code.outputs.xml }}
manifest_repo: seL4/microkit-manifest
manifest_branch: main
manifest: main.xml
env:
GH_SSH: ${{ secrets.CI_SSH }}