-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 2.81 KB
/
smoke.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
name: "Smoke"
on:
push:
branches: [2.*, 3.*, 4.*, main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
permissions:
contents: read
jobs:
smoke:
name: Smoke
runs-on: [self-hosted, linux, x64, aws, quad-xlarge]
timeout-minutes: 60
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
cloud: ["localhost", "microk8s"]
steps:
- name: Install Dependencies
shell: bash
run: |
set -euxo pipefail
echo "/snap/bin" >> $GITHUB_PATH
sudo DEBIAN_FRONTEND=noninteractive apt install -y expect
- name: Checkout
uses: actions/checkout@v4
- name: Setup LXD
if: matrix.cloud == 'localhost'
uses: canonical/setup-lxd@4e959f8e0d9c5feb27d44c5e4d9a330a782edee0
- name: Wait for LXD
if: matrix.cloud == 'localhost'
run: |
while ! ip link show lxdbr0; do
echo "Waiting for lxdbr0..."
sleep 10
done
- name: Setup Docker Mirror
shell: bash
run: |
(cat /etc/docker/daemon.json 2> /dev/null || echo "{}") | yq -o json '.registry-mirrors += ["https://docker-cache.us-west-2.aws.jujuqa.com:443"]' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
docker system info
- name: Setup MicroK8s
if: matrix.cloud == 'microk8s'
uses: balchua/microk8s-actions@13f73436011eb4925c22526f64fb3ecdd81289a9
with:
channel: "1.30-strict/stable"
addons: '["dns", "hostpath-storage", "rbac"]'
launch-configuration: "$GITHUB_WORKSPACE/.github/microk8s-launch-config-aws.yaml"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: setup env
shell: bash
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Install local Juju
shell: bash
run: |
make go-install
- name: Update microk8s operator image
if: matrix.cloud == 'microk8s'
run: |
# TODO: use temporary Docker account (set DOCKER_USERNAME env var)
sg snap_microk8s 'make microk8s-operator-update'
- name: Smoke test (LXD)
if: matrix.cloud == 'localhost'
shell: bash
run: |
cd tests
export MODEL_ARCH=$(go env GOARCH)
export BOOTSTRAP_ADDITIONAL_ARGS="--model-default enable-os-upgrade=false"
# Skip destroy to keep the environment up.
export SKIP_DESTROY=true
./main.sh -v -s 'test_build' smoke
- name: Smoke test (MicroK8s)
if: matrix.cloud == 'microk8s'
shell: bash
run: |
cd tests
export MODEL_ARCH=$(go env GOARCH)
sg snap_microk8s './main.sh -c microk8s -v smoke_k8s'