e2e.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Run secret-dependent e2e tests only after /ok-to-test approval
  2. on:
  3. pull_request:
  4. repository_dispatch:
  5. types: [ok-to-test-command]
  6. permissions:
  7. contents: read
  8. issues: read
  9. pull-requests: read
  10. checks: read
  11. statuses: read
  12. name: e2e tests
  13. env:
  14. # Common versions
  15. GO_VERSION: '1.24'
  16. GINKGO_VERSION: 'v2.8.0'
  17. DOCKER_BUILDX_VERSION: 'v0.4.2'
  18. KIND_VERSION: 'v0.17.0'
  19. KIND_IMAGE: 'kindest/node:v1.26.0'
  20. # Common users. We can't run a step 'if secrets.GHCR_USERNAME != ""' but we can run
  21. # a step 'if env.GHCR_USERNAME' != ""', so we copy these to succinctly test whether
  22. # credentials have been provided before trying to run steps that need them.
  23. TARGET_SHA: ${{ github.event.client_payload.slash_command.args.named.sha }}
  24. GHCR_USERNAME: ${{ github.actor }}
  25. GCP_SM_SA_JSON: ${{ secrets.GCP_SM_SA_JSON}}
  26. GCP_GKE_ZONE: ${{ secrets.GCP_GKE_ZONE}}
  27. GCP_GSA_NAME: ${{ secrets.GCP_GSA_NAME}} # Goolge Service Account
  28. GCP_KSA_NAME: ${{ secrets.GCP_KSA_NAME}} # Kubernetes Service Account
  29. GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID}}
  30. AWS_REGION: "eu-central-1"
  31. AWS_OIDC_ROLE_ARN: ${{ secrets.AWS_OIDC_ROLE_ARN }}
  32. AWS_SA_NAME: ${{ secrets.AWS_SA_NAME }}
  33. AWS_SA_NAMESPACE: ${{ secrets.AWS_SA_NAMESPACE }}
  34. TFC_AZURE_CLIENT_ID: ${{ secrets.TFC_AZURE_CLIENT_ID}}
  35. TFC_AZURE_CLIENT_SECRET: ${{ secrets.TFC_AZURE_CLIENT_SECRET }}
  36. TFC_AZURE_TENANT_ID: ${{ secrets.TFC_AZURE_TENANT_ID}}
  37. TFC_AZURE_SUBSCRIPTION_ID: ${{ secrets.TFC_AZURE_SUBSCRIPTION_ID }}
  38. TFC_VAULT_URL: ${{ secrets.TFC_VAULT_URL}}
  39. SCALEWAY_API_URL: ${{ secrets.SCALEWAY_API_URL }}
  40. SCALEWAY_REGION: ${{ secrets.SCALEWAY_REGION }}
  41. SCALEWAY_PROJECT_ID: ${{ secrets.SCALEWAY_PROJECT_ID }}
  42. SCALEWAY_ACCESS_KEY: ${{ secrets.SCALEWAY_ACCESS_KEY }}
  43. SCALEWAY_SECRET_KEY: ${{ secrets.SCALEWAY_SECRET_KEY }}
  44. DELINEA_TLD: ${{ secrets.DELINEA_TLD }}
  45. DELINEA_URL_TEMPLATE: ${{ secrets.DELINEA_URL_TEMPLATE }}
  46. DELINEA_TENANT: ${{ secrets.DELINEA_TENANT }}
  47. DELINEA_CLIENT_ID: ${{ secrets.DELINEA_CLIENT_ID }}
  48. DELINEA_CLIENT_SECRET: ${{ secrets.DELINEA_CLIENT_SECRET }}
  49. SECRETSERVER_USERNAME: ${{ secrets.SECRETSERVER_USERNAME }}
  50. SECRETSERVER_PASSWORD: ${{ secrets.SECRETSERVER_PASSWORD }}
  51. SECRETSERVER_URL: ${{ secrets.SECRETSERVER_URL }}
  52. GRAFANA_URL: ${{ secrets.GRAFANA_URL }}
  53. GRAFANA_TOKEN: ${{ secrets.GRAFANA_TOKEN }}
  54. jobs:
  55. integration-trusted:
  56. runs-on: ubuntu-latest
  57. permissions:
  58. id-token: write
  59. checks: write
  60. contents: read
  61. if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor !='dependabot[bot]'
  62. steps:
  63. - name: Branch based PR checkout
  64. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  65. - name: Fetch History
  66. run: git fetch --prune --unshallow
  67. - uses: ./.github/actions/e2e
  68. # Repo owner has commented /ok-to-test on a (fork-based) pull request
  69. integration-fork:
  70. runs-on: ubuntu-latest
  71. permissions:
  72. id-token: write
  73. checks: write
  74. contents: read
  75. pull-requests: write
  76. if: github.event_name == 'repository_dispatch'
  77. steps:
  78. # Check out merge commit
  79. - name: Fork based /ok-to-test checkout
  80. uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  81. with:
  82. ref: '${{ env.TARGET_SHA }}'
  83. - name: Fetch History
  84. run: git fetch --prune --unshallow
  85. - id: e2e
  86. uses: ./.github/actions/e2e
  87. - id: create_token
  88. if: always()
  89. uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
  90. with:
  91. app_id: ${{ secrets.APP_ID }}
  92. private_key: ${{ secrets.PRIVATE_KEY }}
  93. - name: Update on Succeess
  94. if: always() && steps.e2e.conclusion == 'success'
  95. uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
  96. with:
  97. token: ${{ steps.create_token.outputs.token }}
  98. issue-number: ${{ github.event.client_payload.pull_request.number }}
  99. body: |
  100. [Bot] - :white_check_mark: [e2e for ${{ env.TARGET_SHA }} passed](https://github.com/external-secrets/external-secrets/actions/runs/${{ github.run_id }})
  101. - name: Update on Failure
  102. if: always() && steps.e2e.conclusion != 'success'
  103. uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
  104. with:
  105. token: ${{ steps.create_token.outputs.token }}
  106. issue-number: ${{ github.event.client_payload.pull_request.number }}
  107. body: |
  108. [Bot] - :x: [e2e for ${{ env.TARGET_SHA }} failed](https://github.com/external-secrets/external-secrets/actions/runs/${{ github.run_id }})