2022-10-20 12:17:33 +00:00
|
|
|
name: Conformance tests
|
2023-01-02 20:51:18 +00:00
|
|
|
|
2022-10-20 12:17:33 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
- 'release*'
|
|
|
|
|
2022-11-23 13:29:57 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-10-20 12:17:33 +00:00
|
|
|
jobs:
|
2023-02-28 09:33:53 +00:00
|
|
|
prepare-images:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-03-24 09:26:01 +00:00
|
|
|
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: build-images
|
|
|
|
- name: ko build
|
2023-04-07 12:10:53 +00:00
|
|
|
run: VERSION=${{ github.ref_name }} make docker-save-image-all
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: upload images archive
|
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
path: kyverno.tar
|
|
|
|
retention-days: 1
|
|
|
|
if-no-files-found: error
|
|
|
|
|
2023-04-10 20:30:49 +00:00
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
# - standard
|
2022-11-04 14:00:31 +00:00
|
|
|
run-conformance:
|
2022-12-21 10:14:53 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-02-28 14:33:46 +00:00
|
|
|
k8s-version:
|
|
|
|
- v1.24.7
|
|
|
|
- v1.25.3
|
|
|
|
- v1.26.0
|
|
|
|
tests:
|
|
|
|
- autogen
|
|
|
|
- cleanup
|
|
|
|
- events
|
|
|
|
- exceptions
|
|
|
|
- generate
|
|
|
|
- mutate
|
2023-03-22 17:12:10 +00:00
|
|
|
- policy-validation
|
2023-02-28 14:33:46 +00:00
|
|
|
- rangeoperators
|
|
|
|
- rbac
|
|
|
|
- reports
|
|
|
|
- validate
|
2023-03-27 16:19:19 +00:00
|
|
|
- verify-manifests
|
2023-02-28 14:33:46 +00:00
|
|
|
- verifyImages
|
|
|
|
- webhooks
|
2022-10-20 12:17:33 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-02-28 09:33:53 +00:00
|
|
|
needs: prepare-images
|
2022-10-20 12:17:33 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-03-24 09:26:01 +00:00
|
|
|
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
|
2023-01-05 15:52:52 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
2022-10-20 12:17:33 +00:00
|
|
|
with:
|
2023-01-05 15:52:52 +00:00
|
|
|
build-cache-key: run-conformance
|
2023-02-28 09:33:53 +00:00
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version }}
|
|
|
|
make kind-create-cluster
|
|
|
|
- name: Download kyverno images archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
2023-01-05 22:36:13 +00:00
|
|
|
with:
|
2023-02-28 09:33:53 +00:00
|
|
|
name: kyverno.tar
|
|
|
|
- name: Load kyverno images archive in kind cluster
|
|
|
|
run: make kind-load-image-archive
|
|
|
|
- name: Install kyverno
|
|
|
|
run: make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
2022-11-04 14:00:31 +00:00
|
|
|
- name: Test with kuttl
|
2023-02-28 14:33:46 +00:00
|
|
|
run: |
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} \
|
|
|
|
--config ./test/conformance/kuttl/_config/common.yaml
|
2022-11-14 20:34:56 +00:00
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
2023-01-05 11:35:04 +00:00
|
|
|
uses: ./.github/actions/kyverno-logs
|
2023-04-10 20:30:49 +00:00
|
|
|
|
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
# - standard
|
|
|
|
# - force-failure-policy-ignore
|
|
|
|
force-failure-policy-ignore:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
k8s-version:
|
|
|
|
- v1.24.7
|
|
|
|
- v1.25.3
|
|
|
|
- v1.26.0
|
|
|
|
tests:
|
|
|
|
- force-failure-policy-ignore
|
|
|
|
- rbac
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: prepare-images
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
|
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version }}
|
|
|
|
make kind-create-cluster
|
|
|
|
- name: Download kyverno images archive
|
|
|
|
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
- name: Load kyverno images archive in kind cluster
|
|
|
|
run: make kind-load-image-archive
|
|
|
|
- name: Install kyverno
|
|
|
|
run: |
|
|
|
|
export USE_CONFIG=standard,force-failure-policy-ignore
|
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
|
|
|
- name: Test with kuttl
|
|
|
|
run: |
|
|
|
|
./.tools/kubectl-kuttl test ./test/conformance/kuttl/${{ matrix.tests }} \
|
|
|
|
--config ./test/conformance/kuttl/_config/common.yaml
|
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|