DNS Groups. #650
Workflow file for this run
This file contains hidden or 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: CI-E2E-0 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - "release-*" | |
| - "ci_*" | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| workflow_dispatch: | |
| inputs: | |
| testRecordsCount: | |
| description: Number of test records to create in each namespace | |
| default: 2 | |
| type: number | |
| 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 | |
| skipAWS: | |
| description: Skip tests with AWS provider | |
| default: false | |
| type: boolean | |
| skipGCP: | |
| description: Skip tests with GCP provider | |
| default: false | |
| type: boolean | |
| skipAzure: | |
| description: Skip tests with Azure provider | |
| default: false | |
| type: boolean | |
| skipCoreDNS: | |
| description: Skip tests with CoreDNS provider | |
| default: false | |
| type: boolean | |
| skipEndpoint: | |
| description: Skip tests with endpoints provider | |
| default: false | |
| type: boolean | |
| merge_group: | |
| types: [ checks_requested ] | |
| pull_request_target: | |
| types: [opened, reopened, synchronize] | |
| branches: | |
| - main | |
| env: | |
| TEST_NAMESPACE: e2e-test | |
| TEST_RECORDS_COUNT: ${{ inputs.testRecordsCount || '2' }} | |
| 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_e2e: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@v3.4.1 | |
| with: | |
| cancel_others: false | |
| paths_ignore: '["**/*.md", "**/*.adoc", "LICENSE"]' | |
| do_not_skip: '["pull_request", "push", "merge_group", "workflow_dispatch", "schedule"]' | |
| e2e-test-suite: | |
| name: E2E Test Suite | |
| if: needs.pre-job.outputs.should_skip_e2e != 'true' | |
| needs: pre-job | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get User Permission | |
| if: ${{ github.event_name == 'pull_request_target' || github.event_name == 'pull_request' }} | |
| id: checkAccess | |
| uses: actions-cool/check-user-permission@v2 | |
| with: | |
| require: write | |
| username: ${{ github.triggering_actor }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check User Permission | |
| if: ${{ (github.event_name == 'pull_request_target' || github.event_name == 'pull_request' ) && steps.checkAccess.outputs.require-result == 'false' }} | |
| run: | | |
| echo "${{ github.triggering_actor }} does not have permissions on this repo." | |
| echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}" | |
| echo "Job originally triggered by ${{ github.actor }}" | |
| exit 1 | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| 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 | |
| kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-coredns | |
| kubectl -n ${{ env.TEST_NAMESPACE }} get secret/dns-provider-credentials-endpoint | |
| - name: Run suite AWS | |
| if: ${{ !inputs.skipAWS }} | |
| 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 }} | |
| export TEST_DNS_CONCURRENT_RECORDS=${{ env.TEST_RECORDS_COUNT }} | |
| make test-e2e | |
| - name: Run suite GCP | |
| if: ${{ !inputs.skipGCP }} | |
| 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 }} | |
| export TEST_DNS_CONCURRENT_RECORDS=${{ env.TEST_RECORDS_COUNT }} | |
| 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') && !inputs.skipAzure }} | |
| 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 }} | |
| export TEST_DNS_CONCURRENT_RECORDS=${{ env.TEST_RECORDS_COUNT }} | |
| make test-e2e | |
| - name: Run suite CoreDNS | |
| if: ${{ !inputs.skipCoreDNS }} | |
| run: | | |
| export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-coredns | |
| export TEST_DNS_ZONE_DOMAIN_NAME=k.example.com | |
| export TEST_DNS_NAMESPACES=${{ env.TEST_NAMESPACE }} | |
| export TEST_DNS_CONCURRENT_RECORDS=1 | |
| make test-e2e | |
| - name: Run suite Endpoint | |
| if: ${{ !inputs.skipEndpoint }} | |
| run: | | |
| export TEST_DNS_PROVIDER_SECRET_NAME=dns-provider-credentials-endpoint | |
| export TEST_DNS_ZONE_DOMAIN_NAME=e2e.kuadrant.local | |
| export TEST_DNS_NAMESPACES=${{ env.TEST_NAMESPACE }} | |
| export TEST_DNS_CONCURRENT_RECORDS=1 | |
| 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")' |