Skip to content

Stop statically compiling the binary #544

Stop statically compiling the binary

Stop statically compiling the binary #544

Workflow file for this run

name: KinD tests
on:
push:
branches:
- main
- release-[0-9]+.[0-9]+
pull_request:
branches:
- main
- release-[0-9]+.[0-9]+
env:
RELEASE_BRANCH: ${{ github.event.pull_request.base.ref || github.ref_name }}
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 and Report Generation
if: matrix.hosted_mode == 'false'
run: |
make test-coverage | tee report_unit.json
make coverage-verify
make gosec-scan
cat gosec.json
- name: Store the GitHub triggering event for the sonarcloud workflow
if: |
matrix.kind == 'latest' &&
matrix.hosted_mode == 'false' &&
github.repository_owner == 'stolostron'
run: |
cat <<EOF > event.json
${{ toJSON(github.event) }}
EOF
- name: Upload artifacts for the sonarcloud workflow
if: |
matrix.kind == 'latest' &&
matrix.hosted_mode == 'false' &&
github.repository_owner == 'stolostron'
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
governance-policy-addon-controller/coverage*.out
governance-policy-addon-controller/event.json
governance-policy-addon-controller/gosec.json
- 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