Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix main integration test on schedule #1319

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 50 additions & 14 deletions .github/workflows/main-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,51 @@ on:

jobs:
build:
name: build api-gateway image
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: api-gateway-manager
dockerfile: Dockerfile
context: .
build-args: |
VERSION=${{ github.sha }}
tags: "${{ github.sha }}"
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.get-sha.outputs.sha }}
steps:
- name: build api-gateway image
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main
if: ${{ github.event_name != 'schedule' }}
with:
name: api-gateway-manager
dockerfile: Dockerfile
context: .
build-args: |
VERSION=${{ github.sha }}
tags: "${{ github.sha }}"
- name: Get SHA from latest run of main integration triggered by push
id: get-latest-push-sha
uses: actions/github-script@v6
if: ${{ github.event_name == 'schedule' }}
with:
script: |
const { data } = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'main-integration.yaml',
branch: 'main',
status: 'success',
per_page: 40
});
const pushRuns = data.workflow_runs.filter(run => run.event === 'push');

if (pushRuns.length === 0) {
throw new Error('No successful push runs found');
}

const latestRun = pushRuns[0];

core.setOutput('sha', latestRun.head_sha);
- name: Set output SHA
id: get-sha
run: |
if [ "${{ github.event_name }}" != "schedule" ]; then
echo "sha=${{ github.sha }}" >> $GITHUB_OUTPUT
else
echo "sha=${{ steps.get-latest-push-sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi

integration-tests:
name: Integration tests
Expand All @@ -42,7 +78,7 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/integration-tests
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ github.sha }}"
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.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"
Expand All @@ -61,7 +97,7 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/integration-tests
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ github.sha }}"
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.build.outputs.sha }}"
test_make_target: ${{ matrix.test_make_target }}

upgrade-tests:
Expand All @@ -74,7 +110,7 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/upgrade-test
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ github.sha }}"
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.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"
Expand All @@ -91,7 +127,7 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/integration-test-gardener
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ github.sha }}"
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.build.outputs.sha }}"
gardener_secret: ${{ secrets.GARDENER_TOKEN }}
script: ./hack/ci/custom-domain-gardener-gcp.sh
client_id: ${{ secrets.CLIENT_ID }}
Expand All @@ -110,7 +146,7 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/integration-test-gardener
with:
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ github.sha }}"
manager_image: "europe-docker.pkg.dev/kyma-project/prod/api-gateway-manager:${{ needs.build.outputs.sha }}"
gardener_secret: ${{ secrets.GARDENER_TOKEN }}
script: ./hack/ci/custom-domain-gardener-aws.sh
client_id: ${{ secrets.CLIENT_ID }}
Expand Down
Loading