Skip to content

Commit

Permalink
Adjust PR workflow to the new test strategy (#1294)
Browse files Browse the repository at this point in the history
* Adjust PR workflow to the new test strategy

* Improvements

* Add build job for the image that allows to push to external img registry

* Rename workflow
  • Loading branch information
kolodziejczak authored Feb 11, 2025
1 parent 7046278 commit d55a1ec
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 207 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow is responsible for all kinds of integration tests run on pull request.
# Those tests depend on a container image so in the first job we wait for the image build to succeed.

name: Pull Request integration tests
name: PR E2E

on:
workflow_call:
Expand All @@ -27,44 +24,8 @@ jobs:
.reuse/**
external-images.yaml
k8s-compatibility-test:
name: Kubernetes version compatibility test
runs-on: ubuntu-latest
needs: [ changed-files ]
if: needs.changed-files.outputs.any_modified == 'true'
strategy:
fail-fast: false
matrix:
test_make_target: [ "configuration-integration-test", "mesh-communication-integration-test", "installation-integration-test", "observability-integration-test" ]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/load-manager-image
- uses: ./.github/actions/k8s-compatibility-test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
test_make_target: ${{ matrix.test_make_target }}
operator-image-name: "istio-manager:PR-${{github.event.number}}"

istio-upgrade-integration-test:
name: Istio upgrade integration test
runs-on: ubuntu-latest
needs: [ changed-files ]
if: needs.changed-files.outputs.any_modified == 'true'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/load-manager-image
- uses: ./.github/actions/upgrade-integration-test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
operator-image-name: "istio-manager:PR-${{github.event.number}}"
target_branch: ${{ github.base_ref }}

istio-integration-test:
name: Istio integration test
istio-e2e-test-k3d:
name: Istio E2E test - k3d
runs-on: ubuntu-latest
needs: [ changed-files ]
if: needs.changed-files.outputs.any_modified == 'true'
Expand All @@ -86,8 +47,8 @@ jobs:
servers-memory: "16"
agents: 2

istio-integration-test-evaluation:
name: Istio integration test evaluation
istio-e2e-test-evaluation-k3d:
name: Istio E2E test (evaluation) - k3d
runs-on: ubuntu-latest
needs: [ changed-files ]
if: needs.changed-files.outputs.any_modified == 'true'
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/pull-build-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: PR Build and Push Manager Image

on:
pull_request_target:
types: [ synchronize, opened, reopened, ready_for_review ]
paths-ignore:
- "docs/**"
- "**/*.md"
- "tests/performance/**"
- "OWNERS"
- "CODEOWNERS"
- ".github/**" #Ignoring since build job isn't triggered on the workflow directory changes
- "external-images.yaml"
branches:
- 'main'

jobs:
build-image:
name: Build and push manager image
environment: ${{ github.event.pull_request.author_association != 'COLLABORATOR' && github.event.pull_request.author_association != 'OWNER' && 'restricted' || 'internal' }}
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.draft == false }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: ./.github/actions/build-manager-image
with:
operator-image-name: "europe-central2-docker.pkg.dev/sap-se-cx-kyma-goat/istio/istio-manager:PR-${{github.event.number}}"
push-image: 'true'
push-sa-key: ${{ secrets.GCP_SA_KEY }}
152 changes: 0 additions & 152 deletions .github/workflows/pull-integration-gardener.yaml

This file was deleted.

15 changes: 4 additions & 11 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pull Request pipeline
name: Pull Request
on:
pull_request:
types: [ synchronize, opened, reopened, ready_for_review ]
Expand Down Expand Up @@ -38,17 +38,10 @@ jobs:
if: github.event.pull_request.draft == false
secrets: inherit

integration-tests:
e2e-tests:
name: Dispatch integration tests
needs: [build-image]
uses: ./.github/workflows/pull-integration.yaml
if: github.event.pull_request.draft == false
secrets: inherit

ui-tests:
name: Dispatch UI tests
needs: [build-image]
uses: ./.github/workflows/call-ui-tests.yaml
uses: ./.github/workflows/call-pull-e2e.yaml
if: github.event.pull_request.draft == false
secrets: inherit

Expand All @@ -59,7 +52,7 @@ jobs:
secrets: inherit

pull-request-status:
needs: [ build-image, unit-tests, integration-tests, ui-tests, verify-pins ]
needs: [ build-image, unit-tests, e2e-tests, verify-pins ]
runs-on: ubuntu-latest
if: always()
steps:
Expand Down

0 comments on commit d55a1ec

Please sign in to comment.