Sonobuoy e2e nigthly tests #281
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: Nightly Latest/Edge Tests | |
on: | |
schedule: | |
- cron: "0 0 * * *" # Runs every midnight | |
pull_request: # todo remove before merge | |
permissions: | |
contents: read | |
jobs: | |
test-integration: | |
name: Integration Test ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.release }} | |
strategy: | |
matrix: | |
os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04"] | |
arch: ["amd64", "arm64"] | |
release: ["latest/edge/moonray", "latest/edge/classic", "latest/edge/strict"] | |
fail-fast: false # TODO: remove once arm64 works | |
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 and tox | |
run: | | |
sudo apt update | |
sudo apt install -y tox | |
sudo snap refresh lxd --channel 5.21/stable | |
sudo lxd init --auto | |
sudo usermod --append --groups lxd $USER | |
sg lxd -c 'lxc version' | |
- name: Create build directory | |
run: mkdir -p build | |
- name: Install ${{ matrix.release }} k8s snap | |
run: | | |
cd build | |
snap download k8s --channel=${{ matrix.release }} --basename k8s | |
#create env variables for artifacts | |
echo "os_dash=${{ matrix.os }}" | sed 's/:/-/g' >> $GITHUB_ENV | |
echo "release_dash=${{ matrix.release }}" | sed 's#/#-#g'>> $GITHUB_ENV | |
- name: Run end to end tests # tox path needs to be specified for arm64 | |
env: | |
TEST_SNAP: ${{ github.workspace }}/build/k8s.snap | |
TEST_SUBSTRATE: lxd | |
TEST_LXD_IMAGE: ${{ matrix.os }} | |
TEST_SNAP_RELEASE: ${{ matrix.release }} | |
TEST_INSPECTION_REPORTS_DIR: ${{ github.workspace }}/inspection-reports | |
# Test the latest (up to) 6 releases for the flavour | |
# TODO(ben): upgrade nightly to run all flavours | |
TEST_VERSION_UPGRADE_CHANNELS: "recent 6 classic" | |
TEST_STRICT_INTERFACE_CHANNELS: "recent 6 strict" | |
run: | | |
# e2e works with Cilium to 1.17 remove if after upgrade | |
if [[ "${{ matrix.release }}" == "latest/edge/moonray" ]]; then | |
export TEST_CNCF_E2E="true" | |
fi | |
export PATH="/home/runner/.local/bin:$PATH" | |
cd tests/integration && sg lxd -c 'tox -vve integration' | |
- name: Prepare inspection reports | |
if: failure() | |
run: | | |
tar -czvf inspection-reports.tar.gz -C ${{ github.workspace }} inspection-reports | |
echo "artifact_name=inspection-reports-${{ matrix.os }}-${{ matrix.arch }}" | sed 's/:/-/g' >> $GITHUB_ENV | |
- name: Upload inspection report artifact | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.artifact_name }} | |
path: ${{ github.workspace }}/inspection-reports_${{ env.os_dash }}_${{ env.release_dash }}_${{ matrix.arch }}.tar.gz | |
- name: Tmate debugging session | |
if: ${{ failure() && github.event_name == 'pull_request' }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 10 | |
- name: Extract CNCF conformance report | |
if: ${{ failure() && matrix.release == 'latest/edge/moonray' }} | |
working-directory: tests/integration | |
run: | | |
tar -xf sonobuoy_e2e.tar.gz --one-top-level | |
- name: Upload CNCF conformance report artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ failure() && matrix.release == 'latest/edge/moonray' }} | |
with: | |
name: report_sonobuoy_e2e_${{ env.os_dash }}_${{ env.release_dash }}_${{ matrix.arch }} | |
path: tests/integration/sonobuoy_e2e |