2024-09-02 19:55:55 +02:00
|
|
|
name: Runs E2E Tests
|
|
|
|
description: Runs E2E tests using chainsaw
|
|
|
|
inputs:
|
|
|
|
k8s-version:
|
|
|
|
description: Kubernetes version
|
|
|
|
required: true
|
2024-09-03 00:24:55 +02:00
|
|
|
kind-config:
|
|
|
|
description: Kind cluster config
|
|
|
|
default: ./scripts/config/kind/default.yaml
|
|
|
|
kyverno-configs:
|
|
|
|
description: Kyverno configs
|
|
|
|
default: standard
|
2024-09-02 19:55:55 +02:00
|
|
|
token:
|
|
|
|
description: GH token
|
|
|
|
required: true
|
2024-09-03 00:24:55 +02:00
|
|
|
chainsaw-config:
|
|
|
|
description: Chainsaw config
|
|
|
|
default: ../../../.chainsaw.yaml
|
2024-10-03 15:38:02 +02:00
|
|
|
tests-path:
|
|
|
|
description: Tests path
|
|
|
|
default: '.'
|
2024-09-03 00:24:55 +02:00
|
|
|
chainsaw-tests:
|
|
|
|
description: Test regex
|
2024-10-03 15:38:02 +02:00
|
|
|
default: ''
|
|
|
|
shard-index:
|
|
|
|
description: Shard index
|
|
|
|
default: '0'
|
|
|
|
shard-count:
|
|
|
|
description: Shard count
|
|
|
|
default: '0'
|
2024-09-02 19:55:55 +02:00
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
# install tools
|
|
|
|
- name: Install helm
|
|
|
|
id: helm
|
|
|
|
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
|
2024-09-09 14:08:41 +02:00
|
|
|
- name: Install Cosign
|
|
|
|
uses: sigstore/cosign-installer@4959ce089c160fddf62f7b42464195ba1a56d382 # v3.6.0
|
2024-09-02 19:55:55 +02:00
|
|
|
- name: Install chainsaw
|
2024-10-02 10:55:36 +00:00
|
|
|
uses: kyverno/action-install-chainsaw@d311eacde764f806c9658574ff64c9c3b21f8397 # v0.2.11
|
2024-09-09 14:08:41 +02:00
|
|
|
with:
|
|
|
|
verify: true
|
2024-09-02 19:55:55 +02:00
|
|
|
# create cluster
|
|
|
|
- name: Create kind cluster
|
|
|
|
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
|
|
|
|
with:
|
|
|
|
node_image: kindest/node:${{ inputs.k8s-version }}
|
|
|
|
cluster_name: kind
|
2024-09-03 00:24:55 +02:00
|
|
|
config: ${{ inputs.kind-config }}
|
2024-09-02 19:55:55 +02:00
|
|
|
# deploy kyverno
|
|
|
|
- name: Download kyverno images archive
|
2024-09-02 23:01:25 +02:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
2024-09-02 19:55:55 +02:00
|
|
|
with:
|
|
|
|
name: kyverno.tar
|
|
|
|
- name: Load kyverno images archive in kind cluster
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
kind load image-archive kyverno.tar --name kind
|
|
|
|
- name: Install kyverno
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
set -e
|
|
|
|
export HELM=${{ steps.helm.outputs.helm-path }}
|
2024-09-03 00:24:55 +02:00
|
|
|
export USE_CONFIG=${{ inputs.kyverno-configs }}
|
2024-09-02 19:55:55 +02:00
|
|
|
make kind-install-kyverno
|
|
|
|
- name: Wait for kyverno ready
|
|
|
|
uses: ./.github/actions/kyverno-wait-ready
|
|
|
|
# run tests
|
|
|
|
- name: Test with Chainsaw
|
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ inputs.token }}
|
|
|
|
run: |
|
|
|
|
set -e
|
2024-10-03 15:38:02 +02:00
|
|
|
cd ./test/conformance/chainsaw
|
|
|
|
chainsaw test ${{ inputs.tests-path }} \
|
|
|
|
--config ${{ inputs.chainsaw-config }} \
|
|
|
|
--include-test-regex '^chainsaw$/${{ inputs.chainsaw-tests }}' \
|
|
|
|
--shard-index ${{ inputs.shard-index }} \
|
|
|
|
--shard-count ${{ inputs.shard-count }}
|
2024-09-02 19:55:55 +02:00
|
|
|
# debug
|
|
|
|
- name: Debug failure
|
|
|
|
if: failure()
|
|
|
|
uses: ./.github/actions/kyverno-logs
|