forked from unikraft/unikraft
-
Notifications
You must be signed in to change notification settings - Fork 0
302 lines (273 loc) · 10 KB
/
integration.yaml
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
name: integration
on:
push:
branches: [staging, stable]
paths-ignore: ['*.md']
pull_request:
types: [opened, synchronize, reopened]
branches: [staging]
paths-ignore: ['*.md']
jobs:
libc-test:
name: libc-test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- plat: qemu
arch: x86_64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch helloworld
uses: actions/checkout@v4
with:
repository: unikraft/app-helloworld
fetch-depth: 1
path: _helloworld
- name: Build and run libc-test via uktest
uses: unikraft/kraftkit@staging
with:
loglevel: debug
workdir: _helloworld
plat: ${{ matrix.plat }}
arch: ${{ matrix.arch }}
execute: true
kraftfile: |
specification: '0.5'
name: helloworld
unikraft:
source: ../
kconfig:
CONFIG_LIBUKTEST: "y"
CONFIG_LIBUKTEST_ALL: "n"
CONFIG_LIBUKTEST_TEST_MYSELF: "n"
CONFIG_LIBUKTEST_LOG_STATS: "y"
CONFIG_LIBUKDEBUG_ANSI_COLOR: "y"
CONFIG_LIBUKDEBUG_PRINTK_INFO: "y"
CONFIG_LIBDEVFS: "y"
CONFIG_LIBDEVFS_DEV_STDOUT: "y"
CONFIG_LIBDEVFS_DEV_NULL_ZERO: "y"
CONFIG_LIBDEVFS_DEV_ZERO: "y"
CONFIG_STACK_SIZE_PAGE_ORDER: 4
libraries:
libc-test:
version: staging
kconfig:
CONFIG_LIBLIBCTEST: "y"
CONFIG_LIBLIBCTEST_STRING_TESTS: "y"
CONFIG_LIBLIBCTEST_PTHREAD_TESTS: "y"
CONFIG_LIBLIBCTEST_CONVERSION_TESTS: "y"
CONFIG_LIBLIBCTEST_REGEX_TESTS: "y"
CONFIG_LIBLIBCTEST_FILE_FOLDER_TESTS: "y"
CONFIG_LIBLIBCTEST_TIME_TESTS: "y"
CONFIG_LIBLIBCTEST_NETWORK_TESTS: "y"
CONFIG_LIBLIBCTEST_SORT_TESTS: "y"
CONFIG_LIBLIBCTEST_STRUCTURE_SEARCH_TESTS: "y"
CONFIG_LIBLIBCTEST_SEMAPHORE_TESTS: "y"
CONFIG_LIBLIBCTEST_RANDOM_TESTS: "y"
CONFIG_LIBLIBCTEST_CRYPT_TESTS: "y"
CONFIG_LIBLIBCTEST_ENV_TESTS: "y"
CONFIG_LIBLIBCTEST_MALLOC_TESTS: "y"
CONFIG_LIBLIBCTEST_TGMATH_TESTS: "y"
CONFIG_LIBLIBCTEST_ICONV_TESTS: "y"
CONFIG_LIBLIBCTEST_UDIV_TESTS: "y"
CONFIG_LIBLIBCTEST_MBFUNC_TESTS: "y"
CONFIG_LIBLIBCTEST_SETJMP_TESTS: "y"
CONFIG_LIBLIBCTEST_FPCLASSIFY_TESTS: "y"
CONFIG_LIBLIBCTEST_POSIX_SPAWN_TESTS: "y"
CONFIG_LIBLIBCTEST_ACCESS_TESTS: "y"
musl:
version: staging
kconfig:
CONFIG_MUSL: "y"
CONFIG_LIBMUSL_COMPLEX: "y"
compiler-rt:
version: staging
targets:
- platform: ${{ matrix.plat }}
architecture: ${{ matrix.arch }}
self-test:
name: self-test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- plat: qemu
arch: x86_64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch helloworld
uses: actions/checkout@v4
with:
repository: unikraft/app-helloworld
fetch-depth: 1
path: _helloworld
- name: Build and run all internal tests via uktest
uses: unikraft/kraftkit@staging
with:
loglevel: debug
workdir: _helloworld
plat: ${{ matrix.plat }}
arch: ${{ matrix.arch }}
execute: true
kraftfile: |
specification: '0.5'
name: helloworld
unikraft:
source: ../
kconfig:
CONFIG_LIBUKTEST: "y"
CONFIG_LIBUKTEST_ALL: "y"
CONFIG_LIBUKTEST_TEST_MYSELF: "y"
CONFIG_LIBUKDEBUG_ANSI_COLOR: "y"
CONFIG_LIBUKDEBUG_PRINTK_INFO: "y"
CONFIG_LIBUKTEST_FAILFAST: "n"
CONFIG_LIBUKTEST_LOG_STATS: "y"
CONFIG_OPTIMIZE_WARNISERROR: "y"
targets:
- platform: ${{ matrix.plat }}
architecture: ${{ matrix.arch }}
helloworld:
name: helloworld
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- plat: qemu
arch: x86_64
- plat: qemu
arch: arm64
- plat: xen
arch: x86_64
- plat: fc
arch: x86_64
- plat: linuxu
arch: x86_64
- plat: linuxu
arch: arm64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch helloworld
uses: actions/checkout@v4
with:
repository: unikraft/app-helloworld
fetch-depth: 1
path: _helloworld
- name: Build helloworld
uses: unikraft/kraftkit@staging
with:
loglevel: debug
workdir: _helloworld
execute: false
plat: ${{ matrix.plat }}
arch: ${{ matrix.arch }}
kraftfile: |
specification: '0.5'
name: helloworld
unikraft:
source: ../
kconfig:
CONFIG_OPTIMIZE_WARNISERROR: "y"
targets:
- platform: ${{ matrix.plat }}
architecture: ${{ matrix.arch }}
catalog-tests:
needs: [libc-test, self-test, helloworld]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/staging' && github.repository_owner == 'unikraft' }}
runs-on: ubuntu-latest
steps:
- name: Check idle
run: |
set -xe;
# Check if there are any ongoing tests (only one repository dispatch exists so we can just check for the status)
# We need to check separately for each status because the API does not support multiple statuses
idle_queued=$(gh run list --repo unikraft/catalog --event repository_dispatch --limit 100 --status queued 2> /dev/null)
idle_in_progress=$(gh run list --repo unikraft/catalog --event repository_dispatch --limit 100 --status in_progress 2> /dev/null)
idle_requested=$(gh run list --repo unikraft/catalog --event repository_dispatch --limit 100 --status requested 2> /dev/null)
idle_waiting=$(gh run list --repo unikraft/catalog --event repository_dispatch --limit 100 --status waiting 2> /dev/null)
if [ -n "$idle_queued" ] || [ -n "$idle_in_progress" ] || [ -n "$idle_requested" ] || [ -n "$idle_waiting" ]; then
echo "There are idle tests, try again later:";
echo "Queued:";
jq "$idle_queued";
echo "In Progress:";
jq "$idle_in_progress";
echo "Requested:";
jq "$idle_requested";
echo "Waiting:";
jq "$idle_waiting";
exit 1;
fi
env:
GITHUB_TOKEN: ${{ secrets.GH_CATALOG_PAT }}
- name: Get the start time
id: start_time
run: echo "start=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> "$GITHUB_OUTPUT"
- name: Repository Dispatch
uses: octokit/[email protected]
with:
route: POST /repos/{owner}/{repo}/dispatches
owner: unikraft
repo: catalog
event_type: core_merge
client_payload: '{"id": "${{ github.run_id }}"}'
env:
GITHUB_TOKEN: ${{ secrets.GH_CATALOG_PAT }}
- name: Fetch catalog results
run: |
set -xe;
sudo apt-get update;
sudo apt-get install -y jq;
today=$(date -u +"%Y-%m-%d");
stop=$(date -u +"%Y-%m-%dT%H:%M:%SZ");
start="${{ steps.start_time.outputs.start }}";
for _ in {1..60}; do
# If there are more than 100 tests, the list will be truncated
# TODO(craciunoiuc): Implement pagination or filter only for not concluded tests
joutput=$(gh run list --repo unikraft/catalog --event repository_dispatch --limit 100 --created "$today" --json displayTitle,conclusion,createdAt);
# Check all the tests if they are successful
# If there is a failure, the workflow will fail-fast
# Filter out tests that were created after $start and before stop and pick only the ones that have the displayTitle==core_merge
fail_output=$(echo "$joutput" | jq -r -c -M --arg start "$start" --arg stop "$stop" '.[] | select(.createdAt <= $stop) | select(.createdAt >= $start) | select(.displayTitle == "core_merge") | select(.conclusion == "failure")');
if [ -n "$fail_output" ]; then
echo "There are failed tests:";
jq "$fail_output";
exit 1;
fi
# If there are tests that are on-going still, we will wait for them to finish
# Filter out tests that were created after $start and before stop and pick only the ones that have the displayTitle==core_merge
ongoing_output=$(echo "$joutput" | jq -r -c -M --arg start "$start" --arg stop "$stop" '.[] | select(.createdAt <= $stop) | select(.createdAt >= $start) | select(.displayTitle == "core_merge") | select(.conclusion == "")')
if [ -z "$ongoing_output" ]; then
echo "All tests have finished successfully";
exit 0;
fi
sleep 30;
done
echo "Timeout waiting for tests to finish";
exit 1;
env:
GITHUB_TOKEN: ${{ secrets.GH_CATALOG_PAT }}
merge-stable:
needs: [catalog-tests]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/staging' && github.repository_owner == 'unikraft' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: staging
- name: Merge stable
run: |
set -xe;
git pull origin stable;
git checkout --track origin/stable;
git rebase staging;
git push origin stable;