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-04-13 10:59:50 +00:00
|
|
|
uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1
|
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:
|
2023-04-13 09:08:54 +00:00
|
|
|
standard:
|
2022-12-21 10:14:53 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-13 09:08:54 +00:00
|
|
|
config:
|
|
|
|
- name: standard
|
|
|
|
values:
|
|
|
|
- standard
|
2023-02-28 14:33:46 +00:00
|
|
|
k8s-version:
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.24
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.24.12
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.25
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.25.8
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.26
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.26.3
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.27
|
|
|
|
version: v1.27.0
|
2023-02-28 14:33:46 +00:00
|
|
|
tests:
|
|
|
|
- autogen
|
|
|
|
- cleanup
|
|
|
|
- events
|
|
|
|
- exceptions
|
2023-04-13 09:50:35 +00:00
|
|
|
- generate/clusterpolicy
|
|
|
|
- generate/policy
|
|
|
|
- generate/validation
|
2023-02-28 14:33:46 +00:00
|
|
|
- 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
|
2023-04-13 09:08:54 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2022-10-20 12:17:33 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-04-13 10:59:50 +00:00
|
|
|
uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1
|
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: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version.version }}
|
2023-02-28 09:33:53 +00:00
|
|
|
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
|
2023-04-13 09:08:54 +00:00
|
|
|
run: |
|
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
|
|
|
make kind-install-kyverno
|
2023-02-28 09:33:53 +00:00
|
|
|
- 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:
|
|
|
|
force-failure-policy-ignore:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-13 09:08:54 +00:00
|
|
|
config:
|
|
|
|
- name: force-failure-policy-ignore
|
|
|
|
values:
|
|
|
|
- standard
|
|
|
|
- force-failure-policy-ignore
|
2023-04-10 20:30:49 +00:00
|
|
|
k8s-version:
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.24
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.24.12
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.25
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.25.8
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.26
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.26.3
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.27
|
|
|
|
version: v1.27.0
|
2023-04-10 20:30:49 +00:00
|
|
|
tests:
|
|
|
|
- force-failure-policy-ignore
|
|
|
|
- rbac
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: prepare-images
|
2023-04-13 09:08:54 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-04-10 20:30:49 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-04-13 10:59:50 +00:00
|
|
|
uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1
|
2023-04-10 20:30:49 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version.version }}
|
2023-04-10 20:30:49 +00:00
|
|
|
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: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
2023-04-10 20:30:49 +00:00
|
|
|
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
|
2023-04-11 12:50:53 +00:00
|
|
|
|
|
|
|
# runs conformance test suites with configuration:
|
|
|
|
default:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-13 09:08:54 +00:00
|
|
|
config:
|
|
|
|
- name: default
|
|
|
|
values:
|
|
|
|
- default
|
2023-04-11 12:50:53 +00:00
|
|
|
k8s-version:
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.24
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.24.12
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.25
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.25.8
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.26
|
2023-04-13 10:21:54 +00:00
|
|
|
version: v1.26.3
|
2023-04-13 09:08:54 +00:00
|
|
|
- name: v1.27
|
|
|
|
version: v1.27.0
|
2023-04-11 12:50:53 +00:00
|
|
|
tests:
|
|
|
|
- rbac
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: prepare-images
|
2023-04-13 09:08:54 +00:00
|
|
|
name: ${{ matrix.k8s-version.name }} - ${{ matrix.config.name }} - ${{ matrix.tests }}
|
2023-04-11 12:50:53 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-04-13 10:59:50 +00:00
|
|
|
uses: actions/checkout@83b7061638ee4956cf7545a6f7efe594e5ad0247 # v3.5.1
|
2023-04-11 12:50:53 +00:00
|
|
|
- name: Setup build env
|
|
|
|
uses: ./.github/actions/setup-build-env
|
|
|
|
with:
|
|
|
|
build-cache-key: run-conformance
|
|
|
|
- name: Create kind cluster
|
|
|
|
run: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export KIND_IMAGE=kindest/node:${{ matrix.k8s-version.version }}
|
2023-04-11 12:50:53 +00:00
|
|
|
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: |
|
2023-04-13 09:08:54 +00:00
|
|
|
export USE_CONFIG=${{ join(matrix.config.values, ',') }}
|
2023-04-11 12:50:53 +00:00
|
|
|
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
|