@@ -15,44 +15,35 @@ jobs:
1515 steps :
1616 - name : Check out code
1717 uses : actions/checkout@v3
18- - name : Prepare environment
18+ - name : Install LXD
19+ if : ${{ !env.ACT }}
20+ shell : bash
21+ # language=bash
22+ run : |
23+ set -euxo pipefail
24+ sudo apt remove lxd lxd-client
25+ sudo snap install lxd yq
26+ sudo lxd waitready
27+ sudo lxd init --auto
28+ sudo chmod a+wr /var/snap/lxd/common/lxd/unix.socket
29+ echo "/snap/bin" >> $GITHUB_PATH
30+ - name : Install juju
1931 shell : bash
2032 env :
2133 JUJU_CHANNEL : " 3.0/stable"
34+ # language=bash
2235 run : |
23- sudo mkdir -p ~/.config
24- sudo chown -R $USER:$USER ~/.config
25- sudo chmod -R 755 ~/.config
26- sudo ls -l -R ~/.config
27- attempts=0
28- while [ $attempts -lt 3 ]; do
29- sudo snap install lxd && break || true
30- attempts=$((attempts + 1))
31- done
32-
33- lxd waitready --timeout 240
34- sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket
35- lxd init --auto --network-address='[::]' --network-port=8443
36+ set -euxo pipefail
37+ sudo snap install juju --channel=$JUJU_CHANNEL
3638 lxc network set lxdbr0 ipv6.address none
37-
38- lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs
39- lxc storage create juju-btrfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-btrfs
40-
41- # TODO (stickupkid): we should be able to use security.priviledged="true",
42- # but for some reason that doesn't work in 2 nested deep containers. So
43- # instead we turn apparmor off, we should investigate why this doesn't work correctly.
44- # lxc profile set default raw.lxc lxc.apparmor.profile=unconfined
45-
46- attempts=0
47- while [ $attempts -lt 3 ]; do
48- sudo snap install juju --channel "${JUJU_CHANNEL}" && break || true
49- attempts=$((attempts + 1))
50- done
51-
39+ - name : Bootstrap controller
40+ shell : bash
41+ # language=bash
42+ run : |
5243 juju bootstrap localhost test \
5344 --config 'identity-url=https://api.staging.jujucharms.com/identity' \
5445 --config 'allow-model-access=true' \
55- --config 'test-mode=true'
46+ --config 'test-mode=true'
5647 - name : Setup Python
5748 uses : actions/setup-python@v2
5849 with :
0 commit comments