-
Notifications
You must be signed in to change notification settings - Fork 29
125 lines (106 loc) · 3.59 KB
/
tests.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
name: Spread tests
on:
schedule:
# Weekly sunday testing for bitrot
- cron: '0 12 * * 0'
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: self-hosted
steps:
- name: Cleanup job workspace
id: cleanup-job-workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- uses: actions/checkout@v2
- name: Build snap
run: |
spread -artifacts=./artifacts google-nested:tests/spread/build/
find ./artifacts -type f -name "*.artifact" -exec cp {} "${{ github.workspace }}" \;
- uses: actions/upload-artifact@v2
with:
name: snaps
path: "${{ github.workspace }}/*.artifact"
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')"
done
tests-main:
runs-on: self-hosted
needs: build
steps:
- name: Cleanup job workspace
id: cleanup-job-workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: snaps
- name: Run tests
run: |
spread google-nested:tests/spread/main/
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')"
done
tests-snapd:
runs-on: ubuntu-latest
needs: build
steps:
- name: Cleanup job workspace
id: cleanup-job-workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- uses: actions/checkout@v2
with:
path: core-initrd
- uses: actions/checkout@v2
with:
repository: 'snapcore/snapd'
path: snapd
- uses: actions/download-artifact@v2
with:
name: snaps
- name: Install spread
run: curl -s https://storage.googleapis.com/snapd-spread-tests/spread/spread-amd64.tar.gz | sudo tar xzv -C /usr/bin
- name: Build image
working-directory: '${{ github.workspace }}'
run: |
. "core-initrd/tests/lib/prepare-utils.sh"
echo "************* INSTALLING DEPS *************"
install_core_initrd_deps '${{ github.workspace }}/core-initrd'
echo "************* DOWNLOADING SNAPS *************"
download_core_initrd_snaps 'edge'
echo "************* PREPAREING CORE22 IMAGE *************"
rm -f "upstream-pc-kernel.snap" "upstream-pc-gadget.snap"
mv "pc-kernel.artifact" "upstream-pc-kernel.snap"
mv "pc-gadget.artifact" "upstream-pc-gadget.snap"
echo "************* BUILDING CORE22 IMAGE *************"
build_core22_image
echo "************* STARTING CORE22 VM *************"
start_snapd_core_vm '${{ github.workspace }}'
cd snapd
# add any test suites that should be tested here
SPREAD_EXTERNAL_ADDRESS=localhost:8022 spread external:ubuntu-core-22-64:tests/smoke/
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')"
done