E2E Weekly #141
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: E2E Weekly | |
on: | |
workflow_dispatch: # Allow manual runs | |
schedule: | |
- cron: '35 16 * * 1' # 16:35 UTC, weekly on Monday | |
jobs: | |
build: | |
name: Build latest binary | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.x | |
- name: checkout source | |
uses: actions/checkout@v4 | |
- name: build | |
run: make build | |
- name: upload build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: konstraint | |
path: build/konstraint | |
e2e-prep: | |
name: Prep for End-to-end Tests | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
steps: | |
- name: checkout source | |
uses: actions/checkout@v4 | |
- name: fetch gatekeeper versions | |
id: fetch-gk-versions | |
working-directory: .github/scripts | |
run: echo "gk-versions=$(./fetch_gk_versions.sh)" >> $GITHUB_OUTPUT | |
outputs: | |
gk-versions: ${{ steps.fetch-gk-versions.outputs.gk-versions }} | |
e2e: | |
name: End-to-end Tests | |
runs-on: ubuntu-latest | |
needs: | |
- e2e-prep | |
strategy: | |
matrix: | |
gk-version: ${{ fromJson(needs.e2e-prep.outputs.gk-versions) }} | |
steps: | |
- name: checkout source | |
uses: actions/checkout@v4 | |
- name: download build | |
uses: actions/download-artifact@v4 | |
with: | |
name: konstraint | |
- name: generate resources | |
run: | | |
chmod +x ./konstraint | |
./konstraint create -o e2e-resources examples | |
./konstraint create -o e2e-resources test | |
- name: create kind cluster | |
run: kind create cluster | |
- name: install gatekeeper | |
env: | |
GK_VERSION: ${{ matrix.gk-version }} | |
run: | | |
helm repo add gk https://open-policy-agent.github.io/gatekeeper/charts | |
kubectl create ns gatekeeper-system | |
helm install gatekeeper gk/gatekeeper -n gatekeeper-system --set replicas=1 --version ${GK_VERSION} --set psp.enabled=false | |
- name: apply resources | |
working-directory: e2e-resources | |
run: | | |
for ct in $(ls template*); do kubectl apply -f $ct; done | |
sleep 60 # gatekeeper takes some time to create the CRDs | |
for c in $(ls constraint*); do kubectl apply -f $c; done |