From b21f992e528b8845666090447df5da592b4dcd24 Mon Sep 17 00:00:00 2001 From: eaudetcobello Date: Wed, 22 May 2024 12:48:28 -0400 Subject: [PATCH] Add initial implementation for conform. GH action Currently, the k8s e2e conformance suite has to be run manually, which is a tedious and time-consuming process. The goal of this PR is to enable engineers to run conformance tests at the click of a button and get the output .tar.gz. --- .github/workflows/conformance.yml | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/conformance.yml diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml new file mode 100644 index 0000000000..14924de13c --- /dev/null +++ b/.github/workflows/conformance.yml @@ -0,0 +1,44 @@ +name: run-conformance-suite + +on: + pull_request + # when complete + # workflow_dispatch: + # inputs: + # channel: + # description: 'Channel to use for MicroK8s' + # required: true + # default: '1.30/stable' + + +jobs: + run-conformance-suite: + name: Run Conformance Suite + runs-on: ubuntu-latest + + env: + CHANNEL: 1.30/stable + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo snap install go --classic + go install github.com/vmware-tanzu/sonobuoy@v0.57.1 + sudo snap install microk8s --classic --channel $CHANNEL + sudo microk8s status --wait-ready + sudo snap install multipass + sudo snap restart multipass.multipassd + + - name: Generate Join Token + id: get_token + run: echo "WORKER_TOKEN=$(microk8s add-node | grep '^microk8s join .* --worker\$' | awk '{print $3}')" >> "$GITHUB_OUTPUT" + + - name: Launch VM and Join Cluster + env: + TOKEN: ${{ steps.get_token.outputs.WORKER_TOKEN }} + run: | + multipass launch --name microk8s-worker-vm + multipass exec microk8s-worker-vm -- bash -c "sudo snap install microk8s --classic --channel $CHANNEL; sudo microk8s join $TOKEN"