-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (85 loc) · 2.95 KB
/
integration-test.yaml
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
name: Integration tests
on:
workflow_call:
jobs:
integration-test:
runs-on: [self-hosted, linux, X64, xlarge, jammy]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch Charm Under Test
uses: actions/download-artifact@v4
with:
name: built-charm
path: built/
- name: Get Charm Under Test Path
id: charm-path
run: echo "charm_path=$(find built/ -name '*.charm' -type f -print)" >> $GITHUB_OUTPUT
- name: Fetch KV Requirer Charm
uses: actions/download-artifact@v4
with:
name: kv-requirer-charm
path: kv-requirer/
- name: Get KV Requirer Charm Path
id: kv-requirer-charm-path
run: echo "charm_path=$(find kv-requirer/ -name '*.charm' -type f -print)" >> $GITHUB_OUTPUT
- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.31-strict/stable
juju-channel: 3.6/stable
lxd-channel: 5.21/stable
- name: Install UV and Tox
run: |
pipx uninstall tox
sudo snap install astral-uv --classic
uv tool install tox --with tox-uv --force
- name: Enable Metallb
run: |
IPADDR=$(ip -4 -j route get 2.2.2.2 | jq -r '.[] | .prefsrc')
IFS='.' read -r i1 i2 i3 i4 <<< "$IPADDR"
START_IP="$i1.$i2.$i3.$((i4+1))"
END_IP="$i1.$i2.$i3.$((i4+9))"
RANGE="$START_IP-$END_IP"
echo "RANGE=$RANGE" >> $GITHUB_OUTPUT
/usr/bin/sg snap_microk8s -c "sudo microk8s enable metallb:$RANGE"
- name: Run integration tests
run: |
tox -e integration -- \
--charm_path="${{ steps.charm-path.outputs.charm_path }}" \
--kv_requirer_charm_path="${{ steps.kv-requirer-charm-path.outputs.charm_path }}" \
--alluredir allure-results
- name: Load test report history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Build test report
uses: simple-elf/allure-report-action@v1.7
if: always()
with:
gh_pages: gh-pages
allure_history: allure-history
allure_results: allure-results
- name: Publish test report
uses: peaceiris/actions-gh-pages@v3
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
- name: Archive charmcraft logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: charmcraft-logs
path: /home/runner/.local/state/charmcraft/log/*.log
- name: Archive juju crashdump
if: failure()
uses: actions/upload-artifact@v4
with:
name: juju-crashdump
path: juju-crashdump-*.tar.xz