forked from canonical/rockcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.27 KB
/
spread.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
name: Spread
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 0 */2 * *"
jobs:
snap-build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build snap
uses: snapcore/action-build@v1
id: rockcraft
- name: Upload snap artifact
uses: actions/upload-artifact@v4
with:
name: snap
path: ${{ steps.rockcraft.outputs.snap }}
snap-tests:
runs-on: [self-hosted, spread-installed]
needs: [snap-build]
steps:
- name: Cleanup job workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout rockcraft
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Download snap artifact
uses: actions/download-artifact@v4
with:
name: snap
path: tests
- name: Run spread
run: spread
- 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