constellation/.github/workflows/e2e-test-weekly.yml
Paul Meyer dea41bd1ed
ci: refactor e2e test failure notifications (#1625)
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2023-04-12 16:06:26 +02:00

193 lines
7.1 KiB
YAML

name: e2e test weekly
on:
workflow_dispatch:
schedule:
- cron: "0 3 * * 6" # At 03:00 on Saturday.
jobs:
find-latest-image:
strategy:
fail-fast: false
matrix:
refStream: ["ref/main/stream/debug/?", "ref/release/stream/stable/?"]
name: Find latest image
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
outputs:
image-main-debug: ${{ steps.relabel-output.outputs.image-main-debug }}
image-release-stable: ${{ steps.relabel-output.outputs.image-release-stable }}
steps:
- name: Checkout
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
- name: Select relevant image
id: select-image-action
uses: ./.github/actions/select_image
with:
osImage: ${{ matrix.refStream }}
- name: Relabel output
id: relabel-output
shell: bash
run: |
ref=$(echo ${{ matrix.refStream }} | cut -d/ -f2)
stream=$(echo ${{ matrix.refStream }} | cut -d/ -f4)
echo "image-$ref-$stream=${{ steps.select-image-action.outputs.osImage }}" | tee -a "$GITHUB_OUTPUT"
e2e-weekly:
strategy:
fail-fast: false
max-parallel: 4
matrix:
test:
[
"sonobuoy full",
"autoscaling",
"perf-bench",
"lb",
"verify",
"recover",
]
provider: ["gcp", "azure", "aws"]
kubernetes-version: ["v1.24", "v1.25", "v1.26"]
refStream: ["ref/main/stream/debug/?", "ref/release/stream/stable/?"]
exclude:
# Verify test runs only on latest kubernetes-version by default.
# Exclude it for main-debug as it needs to run on 1.25 / release-stable.
- test: "verify"
kubernetes-version: "v1.24"
- refStream: "ref/main/stream/debug/?"
test: "verify"
kubernetes-version: "v1.25"
# Recover test runs only on latest kubernetes-version.
- test: "recover"
kubernetes-version: "v1.24"
- test: "recover"
kubernetes-version: "v1.25"
# Autoscaling test runs only on latest kubernetes-version.
- test: "autoscaling"
kubernetes-version: "v1.24"
- test: "autoscaling"
kubernetes-version: "v1.25"
# Perf-Bench test runs only on latest kubernetes-version.
- test: "perf-bench"
kubernetes-version: "v1.24"
- test: "perf-bench"
kubernetes-version: "v1.25"
# lb test runs only on latest kubernetes-version.
- test: "lb"
kubernetes-version: "v1.24"
- test: "lb"
kubernetes-version: "v1.25"
# Currently not supported on AWS.
- test: "autoscaling"
provider: "aws"
- test: "perf-bench"
provider: "aws"
# Only verify for K8s v1.25 on all providers.
- refStream: "ref/release/stream/stable/?"
kubernetes-version: "v1.24"
- refStream: "ref/release/stream/stable/?"
kubernetes-version: "v1.26"
- refStream: "ref/release/stream/stable/?"
test: "lb"
- refStream: "ref/release/stream/stable/?"
test: "perf-bench"
- refStream: "ref/release/stream/stable/?"
test: "autoscaling"
- refStream: "ref/release/stream/stable/?"
test: "sonobuoy full"
- refStream: "ref/release/stream/stable/?"
test: "recover"
runs-on: ubuntu-22.04
permissions:
id-token: write
checks: write
contents: read
needs: [find-latest-image]
steps:
- name: Check out repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
fetch-depth: 0
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
- name: Setup Go environment
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version: "1.20.3"
- name: Run E2E test
id: e2e_test
uses: ./.github/actions/e2e_test
with:
workerNodesCount: "2"
controlNodesCount: "3"
cloudProvider: ${{ matrix.provider }}
osImage: ${{ matrix.refStream == 'ref/release/stream/stable/?' && needs.find-latest-image.outputs.image-release-stable || needs.find-latest-image.outputs.image-main-debug }}
isDebugImage: ${{ matrix.refStream == 'ref/main/stream/debug/?' }}
cliVersion: ${{ matrix.refStream == 'ref/release/stream/stable/?' && needs.find-latest-image.outputs.image-release-stable || '' }}
kubernetesVersion: ${{ matrix.kubernetes-version }}
awsOpenSearchDomain: ${{ secrets.AWS_OPENSEARCH_DOMAIN }}
awsOpenSearchUsers: ${{ secrets.AWS_OPENSEARCH_USER }}
awsOpenSearchPwd: ${{ secrets.AWS_OPENSEARCH_PWD }}
gcpProject: ${{ secrets.GCP_E2E_PROJECT }}
gcpClusterCreateServiceAccount: "constellation-e2e-cluster@constellation-331613.iam.gserviceaccount.com"
gcpIAMCreateServiceAccount: " constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com"
gcpInClusterServiceAccountKey: ${{ secrets.GCP_CLUSTER_SERVICE_ACCOUNT }}
test: ${{ matrix.test }}
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
azureClusterCreateCredentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
azureIAMCreateCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
- name: Always terminate cluster
if: always()
uses: ./.github/actions/constellation_destroy
with:
kubeconfig: ${{ steps.e2e_test.outputs.kubeconfig }}
- name: Always delete IAM configuration
if: always()
uses: ./.github/actions/constellation_iam_destroy
with:
cloudProvider: ${{ matrix.provider }}
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
gcpServiceAccount: "constellation-iam-e2e@constellation-331613.iam.gserviceaccount.com"
- name: Notify about failure
if: failure() && github.ref == 'refs/heads/main'
continue-on-error: true
uses: ./.github/actions/notify_failure
with:
projectWriteToken: ${{ secrets.PROJECT_WRITE_TOKEN }}
teamsWebhookUri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
refStream: ${{ matrix.refStream }}
test: ${{ matrix.test }}
kubernetesVersion: ${{ matrix.kubernetes-version }}
provider: ${{ matrix.provider }}
e2e-upgrade:
strategy:
fail-fast: false
max-parallel: 1
matrix:
fromVersion: ["v2.6.0"]
cloudProvider: ["gcp", "azure"]
name: Run upgrade tests
secrets: inherit
permissions:
id-token: write
contents: read
uses: ./.github/workflows/e2e-upgrade.yml
with:
fromVersion: ${{ matrix.fromVersion }}
cloudProvider: ${{ matrix.cloudProvider }}
workerNodesCount: 2
controlNodesCount: 3