Skip to content

cicd: bump k8s versions for int tests (#1242) #38

cicd: bump k8s versions for int tests (#1242)

cicd: bump k8s versions for int tests (#1242) #38

# 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: Main Integration
on:
push:
paths-ignore:
- "docs/**"
- "**/*.md"
- "CODEOWNERS"
- "sec-scanners-config.yaml"
- ".github/**" #Ignoring since build job isn't triggered on the workflow directory changes
branches:
- main
schedule:
- cron: '0 5 * * *' # Run every day at 05:00 AM
jobs:
wait-for-image-build:
name: Wait for image build
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.get-sha.outputs.sha }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/wait-for-job-succeed-or-fail
if: ${{ github.event_name != 'schedule' }}
with:
job-name: 'post-api-gateway-manager-build'
github-auth-token: ${{ secrets.GITHUB_TOKEN }}
commit-ref: ${{ github.sha }}
- id: get-sha
run: |
if [ "${{ github.event_name }}" != "schedule" ]; then
echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT
else
echo "sha=$(./scripts/get_latest_build_sha.sh)" >> $GITHUB_OUTPUT
fi
integration-tests:
name: Integration tests
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/integration-tests
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.wait-for-image-build.outputs.sha }}"
client_id: ${{ secrets.CLIENT_ID }}
client_secret: ${{ secrets.CLIENT_SECRET }}
oidc_well_known_url: "${{ secrets.OIDC_ISSUER_URL }}/.well-known/openid-configuration"
upgrade-tests:
name: Upgrade tests
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/upgrade-test
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.wait-for-image-build.outputs.sha }}"
client_id: ${{ secrets.CLIENT_ID }}
client_secret: ${{ secrets.CLIENT_SECRET }}
oidc_well_known_url: "${{ secrets.OIDC_ISSUER_URL }}/.well-known/openid-configuration"
target_branch: ${{github.ref_name}}
custom-domain-integration-gcp:
name: Custom domain integration GCP
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: ./.github/actions/integration-test-gardener
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.wait-for-image-build.outputs.sha }}"
gardener_secret: ${{ secrets.GARDENER_TOKEN }}
script: ./hack/ci/custom-domain-gardener-gcp.sh
client_id: ${{ secrets.CLIENT_ID }}
client_secret: ${{ secrets.CLIENT_SECRET }}
oidc_well_known_url: "${{ secrets.OIDC_ISSUER_URL }}/.well-known/openid-configuration"
dns_secret_json: ${{ secrets.DNS_SECRET_JSON }}
custom-domain-integration-aws:
name: Custom domain integration AWS
runs-on: ubuntu-latest
needs: [wait-for-image-build]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: ./.github/actions/integration-test-gardener
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.wait-for-image-build.outputs.sha }}"
gardener_secret: ${{ secrets.GARDENER_TOKEN }}
script: ./hack/ci/custom-domain-gardener-aws.sh
client_id: ${{ secrets.CLIENT_ID }}
client_secret: ${{ secrets.CLIENT_SECRET }}
oidc_well_known_url: "${{ secrets.OIDC_ISSUER_URL }}/.well-known/openid-configuration"
dns_secret_json: ${{ secrets.DNS_SECRET_JSON }}
slack_failed_notification:
name: Slack Notification
runs-on: ubuntu-latest
if: ${{ failure() }}
needs: [integration-tests, upgrade-tests, custom-domain-integration-gcp, custom-domain-integration-aws]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Notify
uses: ./.github/actions/slack-notification-failed-workflow
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}