-
Notifications
You must be signed in to change notification settings - Fork 512
136 lines (118 loc) · 4.28 KB
/
spread.yml
File metadata and controls
136 lines (118 loc) · 4.28 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
name: Spread Tests
on:
pull_request:
push:
branches:
- main
- "hotfix/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout snapcraft
uses: actions/checkout@v5
with:
fetch-depth: 0
# speed up build times by using wheels, when available
- name: Use wheels
run: |
yq eval 'del(.parts.snapcraft.build-environment[] | select(.UV_NO_BINARY == "true"))' -i snap/snapcraft.yaml
- name: Build snapcraft snap
id: build-snapcraft
uses: canonical/action-build@v1
- name: Upload snapcraft snap
uses: actions/upload-artifact@v4
with:
name: snap
path: ${{ steps.build-snapcraft.outputs.snap }}
- name: Verify snapcraft snap
run: |
sudo snap install --dangerous --classic ${{ steps.build-snapcraft.outputs.snap }}
integration-spread-tests:
runs-on: [spread-installed]
needs: build
strategy:
# FIXME: enable fail-fast mode once spread can cancel an executing job.
# Disable fail-fast mode as it doesn't function with spread. It seems
# that cancelling tasks requires short, interruptible actions and
# interrupting spread, notably, does not work today. As such disable
# fail-fast while we tackle that problem upstream.
fail-fast: false
matrix:
spread-jobs:
- google:ubuntu-22.04-64
- google:ubuntu-24.04-64
steps:
- name: Checkout snapcraft
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
- name: Download snapcraft snap
uses: actions/download-artifact@v5
with:
name: snap
path: tests
- name: Run spread
env:
SPREAD_GOOGLE_KEY: ${{ secrets.SPREAD_GOOGLE_KEY }}
UA_TOKEN: ${{ secrets.UA_TOKEN }}
RUN_UA_TESTS: ${{ ! github.event.pull_request.head.repo.fork }}
run: spread ${{ matrix.spread-jobs }}
- 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
integration-spread-tests-store:
runs-on: [spread-installed]
needs: build
strategy:
# FIXME: enable fail-fast mode once spread can cancel an executing job.
# Disable fail-fast mode as it doesn't function with spread. It seems
# that cancelling tasks requires short, interruptible actions and
# interrupting spread, notably, does not work today. As such disable
# fail-fast while we tackle that problem upstream.
fail-fast: false
steps:
- name: Decision to Run
id: decisions
run: |
# Secrets cannot be used in conditionals, so this is our dance:
# https://github.com/actions/runner/issues/520
if [[ -n "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS_STAGING }}" ]]; then
echo RUN=true >> $GITHUB_OUTPUT
else
echo RUN= >> $GITHUB_OUTPUT
fi
- if: steps.decisions.outputs.RUN == 'true'
name: Checkout snapcraft
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: true
- if: steps.decisions.outputs.RUN == 'true'
name: Download snapcraft snap
uses: actions/download-artifact@v5
with:
name: snap
path: tests
- if: steps.decisions.outputs.RUN == 'true'
name: Run spread
env:
SPREAD_GOOGLE_KEY: ${{ secrets.SPREAD_GOOGLE_KEY }}
SNAPCRAFT_ASSERTION_KEY: "${{ secrets.SNAPCRAFT_ASSERTION_KEY }}"
SNAPCRAFT_STORE_CREDENTIALS_STAGING: "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS_STAGING }}"
SNAPCRAFT_STORE_CREDENTIALS_STAGING_CANDID: "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS_STAGING_CANDID }}"
SNAPCRAFT_STORE_CREDENTIALS_STAGING_LEGACY: "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS_STAGING_LEGACY }}"
run: |
spread google:ubuntu-22.04-64:tests/spread/store/
- 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