From 8914392562f6a95b92ede912d052be8ea5a17231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ko=C5=82odziejczak?= <69915024+kolodziejczak@users.noreply.github.com> Date: Mon, 23 Sep 2024 07:33:18 +0200 Subject: [PATCH] Separate pull-integration-gardener between regular and release PRs (#1021) --- .../pull-integration-gardener-release.yaml | 142 ++++++++++++++++++ .../workflows/pull-integration-gardener.yaml | 1 - 2 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pull-integration-gardener-release.yaml diff --git a/.github/workflows/pull-integration-gardener-release.yaml b/.github/workflows/pull-integration-gardener-release.yaml new file mode 100644 index 0000000000..82d22952be --- /dev/null +++ b/.github/workflows/pull-integration-gardener-release.yaml @@ -0,0 +1,142 @@ +# This workflow is responsible for all kinds of integration tests run on pull request to release branch. +# Those tests depend on a container image, so in the first job we wait for the image build to succeed. + +name: PR-release Integration Gardener + +on: + # pull_request_target runs workflows from the base of PR + # It allows the workflow to get the repository secrets + pull_request_target: + types: [ synchronize, opened, reopened, ready_for_review ] + branches: + - 'release-**' + +jobs: + filter-changes: + name: List relevant VCS changes + outputs: + check: ${{ steps.changed-files.outputs.any_modified }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: tj-actions/changed-files@e9772d140489982e0e3704fea5ee93d536f1e275 + id: changed-files + with: + files_ignore: | + docs/** + **/*.md + OWNERS + CODEOWNERS + sec-scanners-config.yaml + .github/** + .** + - name: List all changed files + run: echo '${{ steps.changed-files.outputs.all_changed_files }}' + + build-image: + name: Build manager image + needs: [ filter-changes ] + if: ${{ github.event.pull_request.draft == false && needs.filter-changes.outputs.check == 'true' }} + uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main + with: + name: istio-manager + dockerfile: Dockerfile + context: . + build-args: | + VERSION=PR-${{ github.event.pull_request.head.sha }} + + istio-integration-gcp: + name: Istio integration test GCP + runs-on: ubuntu-latest + needs: [build-image] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - run: ./tests/integration/scripts/gardener-kubeconfig.sh + shell: bash + env: + GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }} + - uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - run: make gardener-istio-integration-test + shell: bash + env: + IMG: "europe-docker.pkg.dev/kyma-project/dev/istio-manager:PR-${{github.event.number}}" + GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml" + GARDENER_PROJECT_NAME: "goats" + GARDENER_PROVIDER_SECRET_NAME: "goat" + GARDENER_PROVIDER: "gcp" + GARDENER_REGION: "europe-west3" + GARDENER_CLUSTER_VERSION: "1.29.7" + MACHINE_TYPE: "n2-standard-4" + DISK_SIZE: 50 + DISK_TYPE: "pd-standard" + SCALER_MAX: 20 + SCALER_MIN: 3 + + istio-integration-aws-specific: + name: Istio integration test AWS specific + runs-on: ubuntu-latest + needs: [build-image] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - run: ./tests/integration/scripts/gardener-kubeconfig.sh + shell: bash + env: + GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }} + - uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - run: make gardener-aws-integration-test + shell: bash + env: + IMG: "europe-docker.pkg.dev/kyma-project/dev/istio-manager:PR-${{github.event.number}}" + GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml" + GARDENER_PROJECT_NAME: "goats" + GARDENER_PROVIDER_SECRET_NAME: "aws-gardener-access" + GARDENER_PROVIDER: "aws" + GARDENER_CLUSTER_VERSION: "1.29.7" + GARDENER_REGION: "eu-west-1" + MACHINE_TYPE: "m5.xlarge" + DISK_SIZE: 50 + DISK_TYPE: "gp2" + SCALER_MAX: 3 + SCALER_MIN: 1 + + istio-integration-gcp-specific: + name: Istio integration test GCP specific + runs-on: ubuntu-latest + needs: [build-image] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: 0 + - run: ./tests/integration/scripts/gardener-kubeconfig.sh + shell: bash + env: + GARDENER_TOKEN: ${{ secrets.GARDENER_TOKEN }} + - uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - run: make gardener-gcp-integration-test + shell: bash + env: + IMG: "europe-docker.pkg.dev/kyma-project/dev/istio-manager:PR-${{github.event.number}}" + GARDENER_KUBECONFIG: "/home/runner/work/istio/istio/gardener_kubeconfig.yaml" + GARDENER_PROJECT_NAME: "goats" + GARDENER_PROVIDER_SECRET_NAME: "goat" + GARDENER_PROVIDER: "gcp" + GARDENER_REGION: "europe-west3" + GARDENER_CLUSTER_VERSION: "1.29.7" + MACHINE_TYPE: "n2-standard-4" + DISK_SIZE: 50 + DISK_TYPE: "pd-standard" + SCALER_MAX: 20 + SCALER_MIN: 3 diff --git a/.github/workflows/pull-integration-gardener.yaml b/.github/workflows/pull-integration-gardener.yaml index 83f7c15d83..fbbea20697 100644 --- a/.github/workflows/pull-integration-gardener.yaml +++ b/.github/workflows/pull-integration-gardener.yaml @@ -9,7 +9,6 @@ on: pull_request_target: types: [ synchronize, opened, reopened, ready_for_review ] branches: - - 'release-**' - 'main' jobs: