Skip to content

Set OperatorPolicy default namespace option #460

Set OperatorPolicy default namespace option

Set OperatorPolicy default namespace option #460

Workflow file for this run

name: KinD tests
on:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash
working-directory: governance-policy-addon-controller
jobs:
kind-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# The "minimum" tag is set in the Makefile
# KinD tags: https://hub.docker.com/r/kindest/node/tags
kind:
- 'minimum'
- 'latest'
hosted_mode:
- "true"
- "false"
name: KinD tests
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: governance-policy-addon-controller
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: governance-policy-addon-controller/go.mod
- name: Create KinD Cluster (${{ matrix.kind }}) and deploy components
env:
KIND_VERSION: ${{ matrix.kind }}
HOSTED_MODE: ${{ matrix.hosted_mode }}
run: |
./build/manage-clusters.sh
- name: Ensure Service Account kubeconfig
run: |
make kind-controller-kubeconfig
make kind-ensure-sa
- if: matrix.hosted_mode == 'false'
name: E2E tests
run: |
export GOPATH=$(go env GOPATH)
make wait-for-work-agent
make e2e-test-coverage
- if: matrix.hosted_mode == 'true'
name: E2E tests hosted mode
run: |
export GOPATH=$(go env GOPATH)
make wait-for-work-agent
make e2e-test-hosted-mode
- name: Test Coverage Verification
if: |
github.event_name == 'pull_request' &&
matrix.hosted_mode == 'false'
run: |
make test-coverage
make coverage-verify
- name: Debug
if: ${{ failure() }}
run: |
RUN_MODE="debug" ./build/manage-clusters.sh
- name: Clean up clusters
if: ${{ always() }}
run: |
RUN_MODE="delete" ./build/manage-clusters.sh