Use ManagedCluster metadata for k8s distro type #323
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: 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@v3 | |
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@v3 | |
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 | |
- 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 |