only drop on all #2
Workflow file for this run
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: integration-test | ||
on: | ||
workflow_call: | ||
inputs: | ||
build_registry: | ||
description: "Workflow build registry used for testing" | ||
type: string | ||
repo_owner: | ||
description: 'Name of repository owner, e.g. "inputs.repo_owner" for ghcr.io' | ||
type: string | ||
build_image_repository: | ||
description: "Workflow build image used for testing, excluding the tag i.e. registry + repository" | ||
type: string | ||
build_tag: | ||
description: "Tag of build image used for testing" | ||
type: string | ||
skip_integration_tests: | ||
description: "Want to skip running certain integration tests 'none', 'non-required', 'all'?" | ||
type: string | ||
cosign_public_key: | ||
description: "Cosign public key used for signing the build image" | ||
type: string | ||
permissions: {} | ||
env: | ||
IMAGEPULLSECRET: dockerconfigjson-ghcr | ||
jobs: | ||
integration-test: | ||
name: integration test | ||
runs-on: ubuntu-latest | ||
if: inputs.skip_integration_tests != 'all' | ||
permissions: | ||
packages: read | ||
env: | ||
IMAGE: ${{ inputs.build_image_repository }} | ||
TAG: ${{ inputs.build_tag }} | ||
COSIGN_PUBLIC_KEY: ${{ inputs.cosign_public_key }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
integration-test-arg: | ||
[ | ||
"regular", | ||
"cosign", | ||
"multi-cosigned", | ||
"rekor-cosigned", | ||
"namespace-val", | ||
"deployment", | ||
"pre-config", | ||
"other-ns", | ||
"configured-cert", | ||
] | ||
services: | ||
alerting-endpoint: | ||
image: securesystemsengineering/alerting-endpoint | ||
ports: | ||
- 56243:56243 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
- name: Login with registry | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ inputs.build_registry }} | ||
username: ${{ inputs.repo_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install yq | ||
run: | | ||
sudo snap install yq | ||
- uses: ./.github/actions/k8s-version-config | ||
name: Setup k8s cluster | ||
with: | ||
k8s-version: v1.25 | ||
- name: Get alerting endpoint IP | ||
id: get_ip | ||
uses: ./.github/actions/alerting-endpoint | ||
- name: Run test | ||
run: | | ||
bash tests/integration/integration-test.sh "${{ matrix.integration-test-arg }}" | ||
env: | ||
ALERTING_ENDPOINT_IP: ${{ steps.get_ip.outputs.ip }} | ||
- name: Display Connaisseur configuration | ||
if: always() | ||
run: | | ||
echo "::group::values.yaml" | ||
yq e '... comments=""' helm/values.yaml | ||
echo "::endgroup::" | ||
- name: Display k8s state if integration test failed | ||
if: failure() | ||
run: | | ||
kubectl describe deployments.apps -n connaisseur -lapp.kubernetes.io/name=connaisseur | ||
kubectl describe pods -n connaisseur -lapp.kubernetes.io/name=connaisseur | ||
- name: Display logs if integration test failed | ||
if: failure() | ||
run: | | ||
kubectl logs -n connaisseur -lapp.kubernetes.io/name=connaisseur --prefix=true | ||
integration-test: | ||
name: integration test | ||
runs-on: ubuntu-latest | ||
if: inputs.skip_integration_tests != 'all' | ||
permissions: | ||
packages: read | ||
env: | ||
IMAGE: ${{ inputs.build_image_repository }} | ||
TAG: ${{ inputs.build_tag }} | ||
COSIGN_PUBLIC_KEY: ${{ inputs.cosign_public_key }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
integration-test-arg: | ||
[ | ||
"complexity", | ||
"load", | ||
"upgrade", | ||
] | ||
services: | ||
alerting-endpoint: | ||
image: securesystemsengineering/alerting-endpoint | ||
ports: | ||
- 56243:56243 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
- name: Login with registry | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ inputs.build_registry }} | ||
username: ${{ inputs.repo_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install yq | ||
run: | | ||
sudo snap install yq | ||
- uses: ./.github/actions/k8s-version-config | ||
name: Setup k8s cluster | ||
with: | ||
k8s-version: v1.25 | ||
- name: Get alerting endpoint IP | ||
id: get_ip | ||
uses: ./.github/actions/alerting-endpoint | ||
- name: Run test | ||
run: | | ||
bash tests/integration/integration-test.sh "${{ matrix.integration-test-arg }}" | ||
env: | ||
ALERTING_ENDPOINT_IP: ${{ steps.get_ip.outputs.ip }} | ||
- name: Display Connaisseur configuration | ||
if: always() | ||
run: | | ||
echo "::group::values.yaml" | ||
yq e '... comments=""' helm/values.yaml | ||
echo "::endgroup::" | ||
- name: Display k8s state if integration test failed | ||
if: failure() | ||
run: | | ||
kubectl describe deployments.apps -n connaisseur -lapp.kubernetes.io/name=connaisseur | ||
kubectl describe pods -n connaisseur -lapp.kubernetes.io/name=connaisseur | ||
- name: Display logs if integration test failed | ||
if: failure() | ||
run: | | ||
kubectl logs -n connaisseur -lapp.kubernetes.io/name=connaisseur --prefix=true | ||
k8s-versions: | ||
runs-on: ubuntu-latest | ||
if: inputs.skip_integration_tests != 'all' | ||
permissions: | ||
packages: read | ||
env: | ||
IMAGE: ${{ inputs.build_image_repository }} | ||
TAG: ${{ inputs.build_tag }} | ||
COSIGN_PUBLIC_KEY: ${{ inputs.cosign_public_key }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
k8s-version: [ | ||
"v1.20", | ||
"v1.21", | ||
"v1.22", | ||
"v1.23", | ||
"v1.24", | ||
"v1.25", | ||
"v1.26", | ||
"v1.27", | ||
] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | ||
- name: Login with registry | ||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
with: | ||
registry: ${{ inputs.build_registry }} | ||
username: ${{ inputs.repo_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install yq | ||
run: | | ||
sudo snap install yq | ||
- uses: ./.github/actions/k8s-version-config | ||
name: Setup k8s cluster | ||
with: | ||
k8s-version: ${{ matrix.k8s-version }} | ||
- name: Run pre-config and workload integration tests | ||
run: | | ||
bash tests/integration/integration-test.sh "pre-and-workload" | ||
- name: Display k8s state and logs if integration test failed | ||
if: failure() | ||
run: | | ||
kubectl describe deployments.apps -n connaisseur -lapp.kubernetes.io/name=connaisseur | ||
kubectl describe pods -n connaisseur -lapp.kubernetes.io/name=connaisseur | ||
kubectl logs -n connaisseur -lapp.kubernetes.io/name=connaisseur --prefix=true |