-
Notifications
You must be signed in to change notification settings - Fork 3
72 lines (70 loc) · 2.67 KB
/
frontend_charm_integration_tests.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
name: Run charm tests
on:
push:
branches: ["main", "integration-test-fix"]
tags: ["v*.*.*"]
jobs:
integration-test:
permissions:
contents: read
packages: read
name: Integration tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup LXD
uses: canonical/setup-lxd@main
with:
channel: 5.13/stable
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main # mz2/actions-operator@4fcb55b99e2a0f69a5910870d3639d203aeb87aa
with:
channel: 1.27-strict/stable # 1.26.4
provider: microk8s
juju-channel: 3.0/stable
# juju-classic-confinement: "false"
# microk8s-classic-confinement: "false"
charmcraft-channel: 2.x/stable
lxd-channel: 5.13/stable
- name: Adjust containerd template to accept ghcr.io images
run: |
sudo mkdir -p /var/snap/microk8s/current/args &&
echo "" | sudo tee -a /var/snap/microk8s/current/args/containerd-template.toml &&
echo '[plugins."io.containerd.grpc.v1.cri".registry.configs."ghcr.io".auth]' | sudo tee -a /var/snap/microk8s/current/args/containerd-template.toml &&
echo ' username = "$GHCR_PACKAGE_API_USER"' | sudo tee -a /var/snap/microk8s/current/args/containerd-template.toml &&
echo ' password = "$GHCR_PACKAGE_API_TOKEN"' | sudo tee -a /var/snap/microk8s/current/args/containerd-template.toml &&
sudo systemctl restart snap.microk8s.daemon-containerd.service &&
sudo microk8s.stop &&
sleep 10 &&
sudo microk8s.start &&
sleep 10 &&
sudo microk8s status --wait-ready &&
sleep 30
env:
GHCR_PACKAGE_API_USER: ${{ secrets.GHCR_PACKAGE_API_USER }}
GHCR_PACKAGE_API_TOKEN: ${{ secrets.GHCR_PACKAGE_API_TOKEN }}
- name: Run integration tests
run: tox -e integration
- name: Archive Tested Charm
uses: actions/upload-artifact@v3
if: ${{ github.ref_name == 'main' }}
with:
name: tested-charm
path: .tox/**/test-observer-frontend_ubuntu-22.04-amd64.charm
retention-days: 5
- name: Archive charmcraft logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: charmcraft-logs
path: /home/runner/.local/state/charmcraft/log/*.log
- name: Archive juju crashdump
if: failure()
uses: actions/upload-artifact@v3
with:
name: juju-crashdump
path: juju-crashdump-*.tar.xz
defaults:
run:
working-directory: ./frontend/charm