Skip to content

Merge pull request #377 from Kuadrant/fix-gnupg-missing-dir #1170

Merge pull request #377 from Kuadrant/fix-gnupg-missing-dir

Merge pull request #377 from Kuadrant/fix-gnupg-missing-dir #1170

Workflow file for this run

name: CI-E2E
on:
push:
branches:
- main
- "release-*"
- "ci_*"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
pull_request_target:
branches:
- main
- "release-*"
workflow_dispatch:
inputs:
ginkgoParallel:
description: Run tests in parallel
default: false
type: boolean
ginkgoDryRun:
description: Run tests with dry run
default: false
type: boolean
ginkgoFlags:
description: Flags to pass directly to the ginkgo command
default: "-v"
type: string
merge_group:
types: [checks_requested]
env:
TEST_NAMESPACE: e2e-test
GINKGO_PARALLEL: ${{ inputs.ginkgoParallel || 'false' }}
GINKGO_DRYRUN: ${{ inputs.ginkgoDryRun || 'false' }}
GINKGO_FLAGS: ${{ inputs.ginkgoFlags || '-v' }}
jobs:
pre-job:
runs-on: ubuntu-latest
name: Pre job checks
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- uses: actions/checkout@v4
- id: skip_check
uses: fkirc/[email protected]
with:
cancel_others: false
paths_ignore: '["**/*.md", "**/*.adoc", "LICENSE"]'
e2e-test-suite:
name: E2E Test Suite
if: needs.pre-job.outputs.should_skip != 'true'
needs: pre-job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-go@v5
with:
go-version: v1.22.x
cache: false
- name: Create AWS provider configuration
run: |
make local-setup-aws-clean local-setup-aws-generate AWS_ACCESS_KEY_ID=${{ secrets.E2E_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY=${{ secrets.E2E_AWS_SECRET_ACCESS_KEY }}
- name: Create GCP provider configuration
run: |
make local-setup-gcp-clean local-setup-gcp-generate GCP_GOOGLE_CREDENTIALS='${{ secrets.E2E_GCP_GOOGLE_CREDENTIALS }}' GCP_PROJECT_ID=${{ secrets.E2E_GCP_PROJECT_ID }}
- name: Create Azure provider configuration
run: |
make local-setup-azure-clean local-setup-azure-generate KUADRANT_AZURE_CREDENTIALS='${{ secrets.E2E_AZURE_CREDENTIALS }}'
- name: Setup environment
if: ${{ !inputs.ginkgoDryRun }}
run: |
make local-setup DEPLOY=true TEST_NAMESPACE=${{ env.TEST_NAMESPACE }}
kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-aws
kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-gcp
kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-azure
- name: Run suite AWS
run: |
export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-aws
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.hcpapps.net
export TEST_DNS_NAMESPACE=${{ env.TEST_NAMESPACE }}
make test-e2e
- name: Run suite GCP
run: |
export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-gcp
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.google.hcpapps.net
export TEST_DNS_NAMESPACES=${{ env.TEST_NAMESPACE }}
make test-e2e
- name: Run suite Azure
if: (github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release-')) || github.event_name == 'workflow_dispatch')
run: |
export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-azure
export TEST_DNS_ZONE_DOMAIN_NAME=e2e.azure.hcpapps.net
export TEST_DNS_NAMESPACES=${{ env.TEST_NAMESPACE }}
make test-e2e
- name: Dump Controller logs
if: ${{ failure() && !inputs.ginkgoDryRun }}
run: |
kubectl get deployments -A
kubectl logs --all-containers --ignore-errors deployments/dns-operator-controller-manager -n dns-operator-system
- name: Dump Controller metrics
if: ${{ success() && !inputs.ginkgoDryRun }}
run: |
kubectl run -q curl --image=curlimages/curl --rm -it --restart=Never --namespace dns-operator-system -- curl -XGET http://dns-operator-controller-manager-metrics-service:8080/metrics > metrics.txt
cat metrics.txt
- uses: actions/upload-artifact@v4
with:
name: metrics
path: metrics.txt
if-no-files-found: warn
- name: Exit as failure if dry run
if: ${{ success() && inputs.ginkgoDryRun }}
run: |
echo "Executed using dry run, exiting as failure"
exit 1
required-checks:
name: CI-E2E Required Checks
# This check adds a list of checks to one job to simplify adding settings to the repo.
# If a new check is added in this file, and it should be retested on entry to the merge queue,
# it needs to be added to the list below aka needs: [ existing check 1, existing check 2, new check ].
needs: [ e2e-test-suite ]
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo '${{ toJSON(needs) }}' | jq -e 'all(.[]; .result == "success" or .result == "skipped")'