-
Notifications
You must be signed in to change notification settings - Fork 7
105 lines (96 loc) · 3.28 KB
/
build-snap.yml
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
name: Build Snap
on:
workflow_call:
outputs:
snap-amd64:
description: "Filename of the built amd64 snap artifact"
value: ${{ jobs.build-amd64.outputs.snap }}
snap-arm64:
description: "Filename of the built arm64 snap artifact"
value: ${{ jobs.build-arm64.outputs.snap }}
jobs:
build-amd64:
name: Build snap amd64
runs-on: ubuntu-latest
outputs:
snap: ${{ steps.snapcraft.outputs.snap }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build snap locally
uses: snapcore/action-build@v1
id: snapcraft
- name: Upload locally built snap artifact
uses: actions/upload-artifact@v4
with:
name: local-${{ steps.snapcraft.outputs.snap }}
path: ${{ steps.snapcraft.outputs.snap }}
build-arm64:
name: Build snap arm64
runs-on: [self-hosted, ARM64]
outputs:
snap: ${{ steps.snapcraft.outputs.snap }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build snap locally
uses: snapcore/action-build@v1
id: snapcraft
- name: Upload locally built snap artifact
uses: actions/upload-artifact@v4
with:
name: local-${{ steps.snapcraft.outputs.snap }}
path: ${{ steps.snapcraft.outputs.snap }}
functional-test-amd64:
needs: build-amd64
name: Functional test
runs-on: [self-hosted, xlarge]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download snap artifact
id: download
uses: actions/download-artifact@v4
with:
name: local-${{ needs.build-amd64.outputs.snap }}
- name: test
run: |
export COLUMNS=256
sudo snap install ${{ needs.build-amd64.outputs.snap }} --dangerous
maas-anvil prepare-node-script | bash -x
sg snap_daemon "maas-anvil -v cluster bootstrap --role database --role region --role agent --role haproxy --accept-defaults"
- name: Collect juju status
if: always()
run: |
juju status
juju debug-log --replay
- name: Setup tmate session
if: ${{ failure() && runner.debug }}
uses: canonical/action-tmate@main
# TODO (@skatsaounis): Uncomment when arm64 installation is supported
# functional-test-arm64:
# needs: build-arm64
# name: Functional test
# runs-on: [self-hosted, large, ARM64]
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Download snap artifact
# id: download
# uses: actions/download-artifact@v4
# with:
# name: local-${{ needs.build-arm64.outputs.snap }}
# - name: test
# run: |
# export COLUMNS=256
# sudo snap install ${{ needs.build-arm64.outputs.snap }} --dangerous
# maas-anvil prepare-node-script | bash -x
# sg snap_daemon "maas-anvil -v cluster bootstrap --role database --role region --role agent --role haproxy --accept-defaults"
# - name: Collect juju status
# if: always()
# run: |
# juju status
# juju debug-log --replay
# - name: Setup tmate session
# if: ${{ failure() && runner.debug }}
# uses: canonical/action-tmate@main