-
Notifications
You must be signed in to change notification settings - Fork 14
80 lines (67 loc) · 2.77 KB
/
sonobuoy-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
name: Sonobuoy Nightly Latest/Edge Tests
on:
workflow_dispatch:
push:
branches:
- KU-269/sonobuoy-e2e
permissions:
contents: read
jobs:
test-integration:
name: Integration Test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.releases }}
strategy:
matrix:
os: [ "ubuntu:24.04"]
arch: ["amd64"]
releases: ["latest/edge"]
runs-on: ${{ matrix.arch == 'arm64' && 'Ubuntu_ARM64_4C_16G_01' || 'ubuntu-20.04' }}
steps:
- name: Checking out repo
uses: actions/checkout@v4
- name: Install lxd
run: |
sudo snap refresh lxd --channel 5.21/stable
sudo lxd init --auto
sudo usermod --append --groups lxd $USER
sg lxd -c 'lxc version'
- name: Install sonobuoy
run: |
release=$(curl --silent -m 10 --connect-timeout 5 "https://api.github.com/repos/vmware-tanzu/sonobuoy/releases/latest")
tag=$(echo "$release" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
curl -L -o sonobuoy.tar.gz https://github.com/vmware-tanzu/sonobuoy/releases/download/${tag}/sonobuoy_${tag//v}_linux_${{ matrix.arch }}.tar.gz
tar -xf sonobuoy.tar.gz
- name: download $${ matrix.releases }} k8s snap
run: |
snap download k8s --channel=${{ matrix.releases }} --basename k8s
- name: create k8s container
run: |
sg lxd -c 'lxc profile create k8s'
sg lxd -c 'cat tests/integration/lxd-profile.yaml | lxc profile edit k8s'
sg lxd -c 'lxc launch -p default -p k8s ${{ matrix.os }} k8s'
sg lxd -c 'lxc config device add k8s repo disk source=${PWD} path=/repo/'
- name: setup k8s in lxd container
run: |
sg lxd -c 'lxc exec k8s -- service snapd start'
sg lxd -c 'lxc exec k8s -- snap install /repo/k8s.snap --dangerous --classic'
sg lxd -c 'lxc exec k8s -- k8s bootstrap'
sg lxd -c 'lxc exec k8s -- k8s status'
mkdir ~/.kube
sg lxd -c 'lxc exec k8s -- k8s config' > ~/.kube/config
- name: Run end to end tests
run: |
./sonobuoy run --plugin e2e --wait --mode quick
./sonobuoy retrieve -f sonobuoy_e2e.tar.gz
./sonobuoy results sonobuoy_e2e.tar.gz
tar -xf sonobuoy_e2e.tar.gz --one-top-level
- name: Upload inspection report artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}_${{ matrix.arch }}
path: sonobuoy_e2e.tar.gz
- name: Test Report
uses: dorny/test-reporter@v1
# if: success() || failure() # run this step even if previous step failed
with:
name: Sonobuoy End to End Tests
path: sonobuoy_e2e/plugins/e2e/sonobuoy_results.yaml
reporter: jest-junit