Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial implementation for conform. GH action #4527

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
sudo snap install microk8s --classic --channel $CHANNEL
sudo microk8s status --wait-ready
sudo snap install multipass
sudo multipass start

- 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: |
sudo multipass launch --name microk8s-worker-vm
sudo multipass exec microk8s-worker-vm -- bash -c "sudo snap install microk8s --classic --channel $CHANNEL; sudo microk8s join $TOKEN"
30 changes: 30 additions & 0 deletions build-scripts/conformance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

KUBECONFIG="/var/snap/microk8s/current/credentials/client.config"
SONOBUOY_BIN=/home/user/go/bin/sonobuoy
E2E_EXTRA_ARGS="--non-blocking-taints=node-role.kubernetes.io/controller --ginkgo.v"
K8S_VERSION="v1.30.0"
CHANNEL="1.30/stable"
EXTRACT_DIR="results"
RESULTS_FILE="${EXTRACT_DIR}/plugins/e2e/results/global/e2e.log"

# This assumes the correct version of microk8s, sonobuoy and multipass are installed.
# For example if CHANNEL=1.30/stable the system should have microk8s 1.30.

function latest_tar_path() {
ls -Art *.tar.gz | tail -n 1
}

function run_e2e() {
"${SONOBUOY_BIN}" run \
--plugin-env=e2e.E2E_EXTRA_ARGS="${E2E_EXTRA_ARGS}" \
--mode=certified-conformance \
--kubernetes-version="${K8S_VERSION}" \
--kubeconfig "${KUBECONFIG}"
}

function extract_results() {
${SONOBUOY_BIN} retrieve --kubeconfig ${KUBECONFIG}
mkdir -p "${EXTRACT_DIR}"
tar xvf "$(latest_tar_path)" -C "${EXTRACT_DIR}"
}
Loading