-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (68 loc) · 1.81 KB
/
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
name: "Snapcraft"
on:
push:
branches: [2.*, 3.*, 4.*, main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**.go'
- 'go.mod'
- 'snap/**'
- '.github/workflows/snap.yml'
- 'scripts/dqlite/**'
- 'Makefile'
- 'make_functions.sh'
workflow_dispatch:
permissions:
contents: read
jobs:
snap:
name: linux-arm64
runs-on: [self-hosted, linux, arm64, aws, large]
if: github.event.pull_request.draft == false
steps:
- name: Install Dependencies
shell: bash
run: |
set -euxo pipefail
sudo snap install snapcraft --classic
echo "/snap/bin" >> $GITHUB_PATH
- name: Checkout
uses: actions/checkout@v4
- name: Setup LXD
uses: canonical/setup-lxd@4e959f8e0d9c5feb27d44c5e4d9a330a782edee0
- name: Wait for LXD
run: |
while ! ip link show lxdbr0; do
echo "Waiting for lxdbr0..."
sleep 10
done
- name: Set up Go
if: env.RUN_TEST == 'RUN'
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Build snap
shell: bash
run: |
set -euxo pipefail
snapcraft --use-lxd
- name: Install snap
shell: bash
run: |
set -euxo pipefail
sudo snap install *.snap --dangerous
# Since we're installing dangerously, we need to
# manually grant permissions to juju
sudo snap connect juju:lxd lxd
sudo snap connect juju:config-lxd
sudo snap connect juju:dot-local-share-juju
sudo snap connect juju:ssh-keys
snap connections juju
- name: Test bootstrap
shell: bash
run: |
set -euxo pipefail
mkdir -p ~/.ssh
juju bootstrap localhost --debug