2021-06-13 13:28:52 +00:00
|
|
|
# Run secret-dependent e2e tests only after /ok-to-test approval
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
repository_dispatch:
|
|
|
|
types: [ok-to-test-command]
|
|
|
|
|
2022-10-29 18:15:50 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
name: e2e tests
|
|
|
|
|
2021-06-13 13:28:52 +00:00
|
|
|
env:
|
|
|
|
# Common versions
|
2023-10-20 00:28:14 +00:00
|
|
|
GO_VERSION: '1.21'
|
2023-02-01 23:53:27 +00:00
|
|
|
GINKGO_VERSION: 'v2.8.0'
|
2021-06-13 13:28:52 +00:00
|
|
|
DOCKER_BUILDX_VERSION: 'v0.4.2'
|
2023-01-13 09:19:25 +00:00
|
|
|
KIND_VERSION: 'v0.17.0'
|
|
|
|
KIND_IMAGE: 'kindest/node:v1.26.0'
|
2021-06-13 13:28:52 +00:00
|
|
|
|
|
|
|
# Common users. We can't run a step 'if secrets.GHCR_USERNAME != ""' but we can run
|
|
|
|
# a step 'if env.GHCR_USERNAME' != ""', so we copy these to succinctly test whether
|
|
|
|
# credentials have been provided before trying to run steps that need them.
|
|
|
|
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
|
2021-06-18 10:14:48 +00:00
|
|
|
GCP_SM_SA_JSON: ${{ secrets.GCP_SM_SA_JSON}}
|
2021-12-29 12:02:56 +00:00
|
|
|
GCP_GKE_ZONE: ${{ secrets.GCP_GKE_ZONE}}
|
|
|
|
GCP_GSA_NAME: ${{ secrets.GCP_GSA_NAME}} # Goolge Service Account
|
|
|
|
GCP_KSA_NAME: ${{ secrets.GCP_KSA_NAME}} # Kubernetes Service Account
|
2021-07-12 18:27:48 +00:00
|
|
|
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID}}
|
2022-10-29 18:15:50 +00:00
|
|
|
|
|
|
|
AWS_REGION: "eu-central-1"
|
|
|
|
AWS_OIDC_ROLE_ARN: ${{ secrets.AWS_OIDC_ROLE_ARN }}
|
|
|
|
|
2023-10-29 20:51:39 +00:00
|
|
|
TFC_AZURE_CLIENT_ID: ${{ secrets.TFC_AZURE_CLIENT_ID}}
|
|
|
|
TFC_AZURE_CLIENT_SECRET: ${{ secrets.TFC_AZURE_CLIENT_SECRET }}
|
|
|
|
TFC_AZURE_TENANT_ID: ${{ secrets.TFC_AZURE_TENANT_ID}}
|
|
|
|
TFC_AZURE_SUBSCRIPTION_ID: ${{ secrets.TFC_AZURE_SUBSCRIPTION_ID }}
|
|
|
|
TFC_VAULT_URL: ${{ secrets.TFC_VAULT_URL}}
|
2024-06-28 14:03:22 +00:00
|
|
|
|
2023-03-16 00:03:52 +00:00
|
|
|
SCALEWAY_API_URL: ${{ secrets.SCALEWAY_API_URL }}
|
|
|
|
SCALEWAY_REGION: ${{ secrets.SCALEWAY_REGION }}
|
|
|
|
SCALEWAY_PROJECT_ID: ${{ secrets.SCALEWAY_PROJECT_ID }}
|
|
|
|
SCALEWAY_ACCESS_KEY: ${{ secrets.SCALEWAY_ACCESS_KEY }}
|
|
|
|
SCALEWAY_SECRET_KEY: ${{ secrets.SCALEWAY_SECRET_KEY }}
|
2023-07-05 14:29:47 +00:00
|
|
|
DELINEA_TLD: ${{ secrets.DELINEA_TLD }}
|
|
|
|
DELINEA_URL_TEMPLATE: ${{ secrets.DELINEA_URL_TEMPLATE }}
|
|
|
|
DELINEA_TENANT: ${{ secrets.DELINEA_TENANT }}
|
|
|
|
DELINEA_CLIENT_ID: ${{ secrets.DELINEA_CLIENT_ID }}
|
|
|
|
DELINEA_CLIENT_SECRET: ${{ secrets.DELINEA_CLIENT_SECRET }}
|
2024-06-28 14:03:22 +00:00
|
|
|
|
|
|
|
SECRETSERVER_USERNAME: ${{ secrets.SECRETSERVER_USERNAME }}
|
|
|
|
SECRETSERVER_PASSWORD: ${{ secrets.SECRETSERVER_PASSWORD }}
|
|
|
|
SECRETSERVER_URL: ${{ secrets.SECRETSERVER_URL }}
|
2021-06-13 13:28:52 +00:00
|
|
|
jobs:
|
2022-10-29 18:15:50 +00:00
|
|
|
|
2021-06-13 13:28:52 +00:00
|
|
|
integration-trusted:
|
|
|
|
runs-on: ubuntu-latest
|
2024-01-18 20:03:07 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
checks: write
|
|
|
|
contents: read
|
2022-08-03 13:30:08 +00:00
|
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor !='dependabot[bot]'
|
2021-06-13 13:28:52 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Branch based PR checkout
|
2024-06-17 15:53:09 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2021-06-13 13:28:52 +00:00
|
|
|
|
|
|
|
- name: Fetch History
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
2022-10-29 18:15:50 +00:00
|
|
|
- uses: ./.github/actions/e2e
|
2021-06-13 13:28:52 +00:00
|
|
|
|
|
|
|
# Repo owner has commented /ok-to-test on a (fork-based) pull request
|
|
|
|
integration-fork:
|
|
|
|
runs-on: ubuntu-latest
|
2024-01-18 20:03:07 +00:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
checks: write
|
|
|
|
contents: read
|
2022-10-29 18:15:50 +00:00
|
|
|
if: github.event_name == 'repository_dispatch'
|
2021-06-13 13:28:52 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
# Check out merge commit
|
|
|
|
- name: Fork based /ok-to-test checkout
|
2024-06-17 15:53:09 +00:00
|
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
2021-06-13 13:28:52 +00:00
|
|
|
with:
|
|
|
|
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
|
|
|
|
|
|
|
|
- name: Fetch History
|
|
|
|
run: git fetch --prune --unshallow
|
|
|
|
|
2022-10-29 18:15:50 +00:00
|
|
|
- uses: ./.github/actions/e2e
|
2021-06-13 13:28:52 +00:00
|
|
|
|
|
|
|
# Update check run called "integration-fork"
|
2024-01-18 20:03:07 +00:00
|
|
|
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
2021-06-13 13:28:52 +00:00
|
|
|
id: update-check-run
|
|
|
|
if: ${{ always() }}
|
|
|
|
env:
|
|
|
|
number: ${{ github.event.client_payload.pull_request.number }}
|
|
|
|
job: ${{ github.job }}
|
|
|
|
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
|
2021-06-25 23:56:42 +00:00
|
|
|
conclusion: ${{ job.status }}
|
2021-06-13 13:28:52 +00:00
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
script: |
|
2022-02-15 15:08:41 +00:00
|
|
|
const { data: pull } = await github.rest.pulls.get({
|
2021-06-13 13:28:52 +00:00
|
|
|
...context.repo,
|
|
|
|
pull_number: process.env.number
|
|
|
|
});
|
|
|
|
const ref = pull.head.sha;
|
2021-11-15 15:47:09 +00:00
|
|
|
console.log("\n\nPR sha: " + ref)
|
2022-02-15 15:08:41 +00:00
|
|
|
const { data: checks } = await github.rest.checks.listForRef({
|
2021-06-13 13:28:52 +00:00
|
|
|
...context.repo,
|
|
|
|
ref
|
|
|
|
});
|
2021-11-15 15:47:09 +00:00
|
|
|
console.log("\n\nPR CHECKS: " + checks)
|
2021-06-13 13:28:52 +00:00
|
|
|
const check = checks.check_runs.filter(c => c.name === process.env.job);
|
2021-11-15 15:47:09 +00:00
|
|
|
console.log("\n\nPR Filtered CHECK: " + check)
|
|
|
|
console.log(check)
|
2022-02-15 15:08:41 +00:00
|
|
|
const { data: result } = await github.rest.checks.update({
|
2021-06-13 13:28:52 +00:00
|
|
|
...context.repo,
|
2021-11-15 15:47:09 +00:00
|
|
|
check_run_id: check[0].id,
|
2021-06-13 13:28:52 +00:00
|
|
|
status: 'completed',
|
|
|
|
conclusion: process.env.conclusion
|
|
|
|
});
|
|
|
|
return result;
|