From 9c74030fa07031b9199cdf420e03f266389e6b9b Mon Sep 17 00:00:00 2001 From: Xin Ruan Date: Thu, 10 Oct 2024 15:04:44 +0200 Subject: [PATCH 1/7] decouple build image from e2e test --- .github/workflows/build-image.yml | 14 ++++++++++---- .github/workflows/test-e2e.yml | 22 +++++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 3b8d371168..dde1d5d63b 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -11,7 +11,8 @@ on: required: false type: string default: "" - + pull_request_target: + types: [ opened, edited, synchronize, reopened, ready_for_review ] permissions: id-token: write # This is required for requesting the JWT token contents: read # This is required for actions/checkout @@ -28,9 +29,14 @@ jobs: id: get_tag run: | if [[ "${{ inputs.tag }}" != "" ]]; then - echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT - elif [[ "${{ github.event_name }}" == "push" ]]; then - echo "tag=latest" >> $GITHUB_OUTPUT + echo "tags=${{ inputs.tag }}" >> $GITHUB_OUTPUT + else + { + echo 'tags<> "$GITHUB_OUTPUT" fi - name: Echo the tag run: echo ${{ steps.get_tag.outputs.tag }} diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 5ed84ed7e8..42d8579ad4 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -1,20 +1,32 @@ name: TestSuite E2E +env: + IMAGE_REPO: europe-docker.pkg.dev/kyma-project/dev/lifecycle-manager on: workflow_dispatch: inputs: k8s_version: description: With Kubernetes version required: false - pull_request_target: + pull_request: types: [ opened, edited, synchronize, reopened, ready_for_review ] + branches: + - main + - feat/** jobs: - build-image: - name: Build Image - uses: ./.github/workflows/build-image.yml + wait-for-image-build: + name: Wait for image build + runs-on: ubuntu-latest + steps: + - name: Wait for the Docker image + timeout-minutes: 20 + env: + ITERATIONS: 40 + SLEEP_SECONDS: 30 + run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.pull_request.head.sha }} $ITERATIONS $SLEEP_SECONDS e2e-integration: name: E2E - needs: build-image + needs: wait-for-image-build strategy: fail-fast: false matrix: From 563732f7b1985f393d72e73ef6ca8fd502803add Mon Sep 17 00:00:00 2001 From: Xin Ruan Date: Thu, 10 Oct 2024 15:51:57 +0200 Subject: [PATCH 2/7] decouple build image from e2e test --- .github/workflows/build-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index dde1d5d63b..acc4f329f0 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -29,10 +29,10 @@ jobs: id: get_tag run: | if [[ "${{ inputs.tag }}" != "" ]]; then - echo "tags=${{ inputs.tag }}" >> $GITHUB_OUTPUT + echo "tag=${{ inputs.tag }}" >> $GITHUB_OUTPUT else { - echo 'tags< Date: Thu, 10 Oct 2024 15:56:05 +0200 Subject: [PATCH 3/7] decouple build image from e2e test --- .github/workflows/build-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index acc4f329f0..4579201a30 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -39,7 +39,8 @@ jobs: } >> "$GITHUB_OUTPUT" fi - name: Echo the tag - run: echo ${{ steps.get_tag.outputs.tag }} + run: | + printf "%s\n" "${{ steps.get_tag.outputs.tag }}" build-image: needs: compute-tag uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main From da9671089c1321d28fb363910f4911928218209f Mon Sep 17 00:00:00 2001 From: Xin Ruan Date: Thu, 10 Oct 2024 16:06:32 +0200 Subject: [PATCH 4/7] decouple build image from e2e test --- .github/workflows/build-image.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 4579201a30..4f1dae7818 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -38,9 +38,6 @@ jobs: echo 'TAGS' } >> "$GITHUB_OUTPUT" fi - - name: Echo the tag - run: | - printf "%s\n" "${{ steps.get_tag.outputs.tag }}" build-image: needs: compute-tag uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main From 8f1ace406766d0d06d3d7debe39cbc37d9ae2705 Mon Sep 17 00:00:00 2001 From: Xin Ruan Date: Thu, 10 Oct 2024 16:15:25 +0200 Subject: [PATCH 5/7] decouple build image from e2e test --- .github/workflows/test-e2e.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 42d8579ad4..e9f7ecbadf 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -10,9 +10,6 @@ on: required: false pull_request: types: [ opened, edited, synchronize, reopened, ready_for_review ] - branches: - - main - - feat/** jobs: wait-for-image-build: name: Wait for image build From 80c127b23559957d97b31923bf0dd1d5f5c0cc1e Mon Sep 17 00:00:00 2001 From: Xin Ruan Date: Thu, 10 Oct 2024 16:19:11 +0200 Subject: [PATCH 6/7] decouple build image from e2e test --- .github/workflows/test-e2e.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index e9f7ecbadf..95a0fbabff 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -15,6 +15,10 @@ jobs: name: Wait for image build runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Wait for the Docker image timeout-minutes: 20 env: From 54ff7f0aae58a2b210899b4350d02b41631985a3 Mon Sep 17 00:00:00 2001 From: Xin Ruan Date: Thu, 10 Oct 2024 16:26:50 +0200 Subject: [PATCH 7/7] decouple build image from e2e test --- .github/workflows/create-release.yml | 2 +- .github/workflows/test-e2e.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d1cc7e843f..069d824a13 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -73,7 +73,7 @@ jobs: env: ITERATIONS: 40 SLEEP_SECONDS: 30 - run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.inputs.name }} $ITERATIONS $SLEEP_SECONDS + run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.inputs.name }} ${{ env.ITERATIONS }} ${{ env.SLEEP_SECONDS }} - name: Publish release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 95a0fbabff..b5c9c52ecb 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -24,7 +24,7 @@ jobs: env: ITERATIONS: 40 SLEEP_SECONDS: 30 - run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.pull_request.head.sha }} $ITERATIONS $SLEEP_SECONDS + run: ./.github/scripts/release/wait_for_image.sh ${{ env.IMAGE_REPO }}:${{ github.event.pull_request.head.sha }} ${{ env.ITERATIONS }} ${{ env.SLEEP_SECONDS}} e2e-integration: name: E2E needs: wait-for-image-build