Sonobuoy Nightly Tests #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sonobuoy Nightly Latest/Edge Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- KU-269/sonobuoy-e2e | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
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' | |
echo "os_dash=${{ matrix.os }}" | sed 's/:/-/g' >> $GITHUB_ENV | |
- 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 --wait-ready' | |
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: report_sonobuoy_e2e_${{ github.os_dash }}_${{ matrix.arch }} | |
path: sonobuoy_e2e | |
- 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/results/global/*.xml | |
reporter: jest-junit |