|
@@ -104,6 +104,37 @@ env:
|
|
|
VERSION: "e2e"
|
|
VERSION: "e2e"
|
|
|
|
|
|
|
|
jobs:
|
|
jobs:
|
|
|
|
|
+ # Turn e2e/matrix.yaml into the test job's strategy matrix. Validating here
|
|
|
|
|
+ # (check-matrix.sh) fails the run early if a provider was added to the suite
|
|
|
|
|
+ # without a covering leg, rather than letting it go silently untested.
|
|
|
|
|
+ prepare-matrix:
|
|
|
|
|
+ runs-on: ubuntu-latest
|
|
|
|
|
+ permissions:
|
|
|
|
|
+ contents: read
|
|
|
|
|
+ outputs:
|
|
|
|
|
+ matrix: ${{ steps.set.outputs.matrix }}
|
|
|
|
|
+ steps:
|
|
|
|
|
+ - uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
|
|
|
|
|
+ with:
|
|
|
|
|
+ egress-policy: audit
|
|
|
|
|
+
|
|
|
|
|
+ - name: Checkout
|
|
|
|
|
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
|
|
|
+ with:
|
|
|
|
|
+ ref: ${{ env.TARGET_SHA || github.sha }}
|
|
|
|
|
+ persist-credentials: false
|
|
|
|
|
+
|
|
|
|
|
+ - name: Validate and build the e2e matrix
|
|
|
|
|
+ id: set
|
|
|
|
|
+ # This job has no secrets in scope. matrix.py reads only matrix.yaml and
|
|
|
|
|
+ # the workflow text, so the plan below proves per-leg credential scoping
|
|
|
|
|
+ # without ever touching a secret value.
|
|
|
|
|
+ run: |
|
|
|
|
|
+ ./e2e/matrix.py check
|
|
|
|
|
+ ./e2e/matrix.py plan
|
|
|
|
|
+ matrix="$(./e2e/matrix.py json)"
|
|
|
|
|
+ echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
|
|
|
|
|
+
|
|
|
build:
|
|
build:
|
|
|
runs-on: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
|
permissions:
|
|
permissions:
|
|
@@ -176,16 +207,30 @@ jobs:
|
|
|
retention-days: 1
|
|
retention-days: 1
|
|
|
|
|
|
|
|
test:
|
|
test:
|
|
|
- needs: build
|
|
|
|
|
|
|
+ needs: [build, prepare-matrix]
|
|
|
|
|
+ # One leg per enabled area in e2e/matrix.yaml. Each leg builds its own kind
|
|
|
|
|
+ # cluster and runs a single suite under one label filter, so a flaky addon
|
|
|
|
|
+ # in one provider cannot fail the others. fail-fast is off so one red leg
|
|
|
|
|
+ # does not cancel the rest.
|
|
|
|
|
+ strategy:
|
|
|
|
|
+ fail-fast: false
|
|
|
|
|
+ matrix: ${{ fromJSON(needs.prepare-matrix.outputs.matrix) }}
|
|
|
|
|
+ name: test (${{ matrix.name }})
|
|
|
runs-on: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
|
permissions:
|
|
permissions:
|
|
|
id-token: write # for oidc auth with aws/gcp/azure
|
|
id-token: write # for oidc auth with aws/gcp/azure
|
|
|
contents: read # for checkout
|
|
contents: read # for checkout
|
|
|
env:
|
|
env:
|
|
|
- # Role ARN (an identifier, not a credential) lives at job level so the AWS
|
|
|
|
|
- # step can be skipped when it is absent, e.g. fork runs without secrets.
|
|
|
|
|
- # The actual provider credentials stay scoped to the Run e2e step below.
|
|
|
|
|
- AWS_OIDC_ROLE_ARN: ${{ secrets.AWS_OIDC_ROLE_ARN }}
|
|
|
|
|
|
|
+ # AWS_OIDC_ROLE_ARN is an identifier, not a credential, but it is still
|
|
|
|
|
+ # injected only for legs whose secret_groups include "aws", so the
|
|
|
|
|
+ # Configure AWS step (and AWS auth) is skipped on every other leg. The
|
|
|
|
|
+ # per-provider credentials are scoped the same way, per leg, in the Run
|
|
|
|
|
+ # e2e step below: a vault or core-smoke leg receives no cloud secrets.
|
|
|
|
|
+ AWS_OIDC_ROLE_ARN: ${{ contains(matrix.secret_groups, 'aws') && secrets.AWS_OIDC_ROLE_ARN || '' }}
|
|
|
|
|
+ # Selects the suite binary and label filter for this leg. run.sh forwards
|
|
|
|
|
+ # both into the e2e pod; entrypoint.sh runs ginkgo with them.
|
|
|
|
|
+ TEST_SUITES: ${{ matrix.suite }}
|
|
|
|
|
+ GINKGO_LABELS: ${{ matrix.labels }}
|
|
|
steps:
|
|
steps:
|
|
|
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
|
|
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
|
|
|
with:
|
|
with:
|
|
@@ -219,43 +264,47 @@ jobs:
|
|
|
path: e2e/image-artifacts
|
|
path: e2e/image-artifacts
|
|
|
|
|
|
|
|
- name: Run e2e
|
|
- name: Run e2e
|
|
|
|
|
+ # Each provider's secrets are injected only when this leg's
|
|
|
|
|
+ # secret_groups (from e2e/matrix.yaml) lists that group; otherwise the
|
|
|
|
|
+ # value is empty. So a leg receives exactly the credentials it needs and
|
|
|
|
|
+ # nothing else, instead of every leg seeing every secret.
|
|
|
env:
|
|
env:
|
|
|
- GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
|
|
|
|
|
- GCP_FED_REGION: ${{ secrets.GCP_FED_REGION }}
|
|
|
|
|
- GCP_GSA_NAME: ${{ secrets.GCP_GSA_NAME }}
|
|
|
|
|
- GCP_KSA_NAME: ${{ secrets.GCP_KSA_NAME }}
|
|
|
|
|
- GCP_FED_PROJECT_ID: ${{ secrets.GCP_FED_PROJECT_ID }}
|
|
|
|
|
- AWS_SA_NAME: ${{ secrets.AWS_SA_NAME }}
|
|
|
|
|
- AWS_SA_NAMESPACE: ${{ secrets.AWS_SA_NAMESPACE }}
|
|
|
|
|
- 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 }}
|
|
|
|
|
- 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 }}
|
|
|
|
|
- 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 }}
|
|
|
|
|
- SECRETSERVER_USERNAME: ${{ secrets.SECRETSERVER_USERNAME }}
|
|
|
|
|
- SECRETSERVER_PASSWORD: ${{ secrets.SECRETSERVER_PASSWORD }}
|
|
|
|
|
- SECRETSERVER_URL: ${{ secrets.SECRETSERVER_URL }}
|
|
|
|
|
- GRAFANA_URL: ${{ secrets.GRAFANA_URL }}
|
|
|
|
|
- GRAFANA_TOKEN: ${{ secrets.GRAFANA_TOKEN }}
|
|
|
|
|
- AKEYLESS_ACCESS_ID: ${{ secrets.AKEYLESS_ACCESS_ID }}
|
|
|
|
|
- AKEYLESS_ACCESS_TYPE: ${{ secrets.AKEYLESS_ACCESS_TYPE }}
|
|
|
|
|
- AKEYLESS_ACCESS_TYPE_PARAM: ${{ secrets.AKEYLESS_ACCESS_TYPE_PARAM }}
|
|
|
|
|
- GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
|
|
|
|
|
- GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }}
|
|
|
|
|
- GITLAB_ENVIRONMENT: ${{ secrets.GITLAB_ENVIRONMENT }}
|
|
|
|
|
- ORACLE_USER_OCID: ${{ secrets.ORACLE_USER_OCID }}
|
|
|
|
|
- ORACLE_TENANCY_OCID: ${{ secrets.ORACLE_TENANCY_OCID }}
|
|
|
|
|
- ORACLE_REGION: ${{ secrets.ORACLE_REGION }}
|
|
|
|
|
- ORACLE_FINGERPRINT: ${{ secrets.ORACLE_FINGERPRINT }}
|
|
|
|
|
- ORACLE_KEY: ${{ secrets.ORACLE_KEY }}
|
|
|
|
|
|
|
+ GCP_SERVICE_ACCOUNT_KEY: ${{ contains(matrix.secret_groups, 'gcp') && secrets.GCP_SERVICE_ACCOUNT_KEY || '' }}
|
|
|
|
|
+ GCP_FED_REGION: ${{ contains(matrix.secret_groups, 'gcp') && secrets.GCP_FED_REGION || '' }}
|
|
|
|
|
+ GCP_GSA_NAME: ${{ contains(matrix.secret_groups, 'gcp') && secrets.GCP_GSA_NAME || '' }}
|
|
|
|
|
+ GCP_KSA_NAME: ${{ contains(matrix.secret_groups, 'gcp') && secrets.GCP_KSA_NAME || '' }}
|
|
|
|
|
+ GCP_FED_PROJECT_ID: ${{ contains(matrix.secret_groups, 'gcp') && secrets.GCP_FED_PROJECT_ID || '' }}
|
|
|
|
|
+ AWS_SA_NAME: ${{ contains(matrix.secret_groups, 'aws') && secrets.AWS_SA_NAME || '' }}
|
|
|
|
|
+ AWS_SA_NAMESPACE: ${{ contains(matrix.secret_groups, 'aws') && secrets.AWS_SA_NAMESPACE || '' }}
|
|
|
|
|
+ TFC_AZURE_CLIENT_ID: ${{ contains(matrix.secret_groups, 'azure') && secrets.TFC_AZURE_CLIENT_ID || '' }}
|
|
|
|
|
+ TFC_AZURE_CLIENT_SECRET: ${{ contains(matrix.secret_groups, 'azure') && secrets.TFC_AZURE_CLIENT_SECRET || '' }}
|
|
|
|
|
+ TFC_AZURE_TENANT_ID: ${{ contains(matrix.secret_groups, 'azure') && secrets.TFC_AZURE_TENANT_ID || '' }}
|
|
|
|
|
+ TFC_AZURE_SUBSCRIPTION_ID: ${{ contains(matrix.secret_groups, 'azure') && secrets.TFC_AZURE_SUBSCRIPTION_ID || '' }}
|
|
|
|
|
+ TFC_VAULT_URL: ${{ contains(matrix.secret_groups, 'azure') && secrets.TFC_VAULT_URL || '' }}
|
|
|
|
|
+ SCALEWAY_API_URL: ${{ contains(matrix.secret_groups, 'scaleway') && secrets.SCALEWAY_API_URL || '' }}
|
|
|
|
|
+ SCALEWAY_REGION: ${{ contains(matrix.secret_groups, 'scaleway') && secrets.SCALEWAY_REGION || '' }}
|
|
|
|
|
+ SCALEWAY_PROJECT_ID: ${{ contains(matrix.secret_groups, 'scaleway') && secrets.SCALEWAY_PROJECT_ID || '' }}
|
|
|
|
|
+ SCALEWAY_ACCESS_KEY: ${{ contains(matrix.secret_groups, 'scaleway') && secrets.SCALEWAY_ACCESS_KEY || '' }}
|
|
|
|
|
+ SCALEWAY_SECRET_KEY: ${{ contains(matrix.secret_groups, 'scaleway') && secrets.SCALEWAY_SECRET_KEY || '' }}
|
|
|
|
|
+ DELINEA_TLD: ${{ contains(matrix.secret_groups, 'delinea') && secrets.DELINEA_TLD || '' }}
|
|
|
|
|
+ DELINEA_URL_TEMPLATE: ${{ contains(matrix.secret_groups, 'delinea') && secrets.DELINEA_URL_TEMPLATE || '' }}
|
|
|
|
|
+ DELINEA_TENANT: ${{ contains(matrix.secret_groups, 'delinea') && secrets.DELINEA_TENANT || '' }}
|
|
|
|
|
+ DELINEA_CLIENT_ID: ${{ contains(matrix.secret_groups, 'delinea') && secrets.DELINEA_CLIENT_ID || '' }}
|
|
|
|
|
+ DELINEA_CLIENT_SECRET: ${{ contains(matrix.secret_groups, 'delinea') && secrets.DELINEA_CLIENT_SECRET || '' }}
|
|
|
|
|
+ SECRETSERVER_USERNAME: ${{ contains(matrix.secret_groups, 'secretserver') && secrets.SECRETSERVER_USERNAME || '' }}
|
|
|
|
|
+ SECRETSERVER_PASSWORD: ${{ contains(matrix.secret_groups, 'secretserver') && secrets.SECRETSERVER_PASSWORD || '' }}
|
|
|
|
|
+ SECRETSERVER_URL: ${{ contains(matrix.secret_groups, 'secretserver') && secrets.SECRETSERVER_URL || '' }}
|
|
|
|
|
+ GRAFANA_URL: ${{ contains(matrix.secret_groups, 'grafana') && secrets.GRAFANA_URL || '' }}
|
|
|
|
|
+ GRAFANA_TOKEN: ${{ contains(matrix.secret_groups, 'grafana') && secrets.GRAFANA_TOKEN || '' }}
|
|
|
|
|
+ AKEYLESS_ACCESS_ID: ${{ contains(matrix.secret_groups, 'akeyless') && secrets.AKEYLESS_ACCESS_ID || '' }}
|
|
|
|
|
+ AKEYLESS_ACCESS_TYPE: ${{ contains(matrix.secret_groups, 'akeyless') && secrets.AKEYLESS_ACCESS_TYPE || '' }}
|
|
|
|
|
+ AKEYLESS_ACCESS_TYPE_PARAM: ${{ contains(matrix.secret_groups, 'akeyless') && secrets.AKEYLESS_ACCESS_TYPE_PARAM || '' }}
|
|
|
|
|
+ GITLAB_TOKEN: ${{ contains(matrix.secret_groups, 'gitlab') && secrets.GITLAB_TOKEN || '' }}
|
|
|
|
|
+ GITLAB_PROJECT_ID: ${{ contains(matrix.secret_groups, 'gitlab') && secrets.GITLAB_PROJECT_ID || '' }}
|
|
|
|
|
+ GITLAB_ENVIRONMENT: ${{ contains(matrix.secret_groups, 'gitlab') && secrets.GITLAB_ENVIRONMENT || '' }}
|
|
|
|
|
+ ORACLE_USER_OCID: ${{ contains(matrix.secret_groups, 'oracle') && secrets.ORACLE_USER_OCID || '' }}
|
|
|
|
|
+ ORACLE_TENANCY_OCID: ${{ contains(matrix.secret_groups, 'oracle') && secrets.ORACLE_TENANCY_OCID || '' }}
|
|
|
|
|
+ ORACLE_REGION: ${{ contains(matrix.secret_groups, 'oracle') && secrets.ORACLE_REGION || '' }}
|
|
|
|
|
+ ORACLE_FINGERPRINT: ${{ contains(matrix.secret_groups, 'oracle') && secrets.ORACLE_FINGERPRINT || '' }}
|
|
|
|
|
+ ORACLE_KEY: ${{ contains(matrix.secret_groups, 'oracle') && secrets.ORACLE_KEY || '' }}
|
|
|
run: make -C e2e test.run
|
|
run: make -C e2e test.run
|