e2e.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. name: e2e tests
  9. env:
  10. # Common versions
  11. KIND_VERSION: 'v0.30.0'
  12. KIND_IMAGE: 'kindest/node:v1.33.4'
  13. # Common users. We can't run a step 'if secrets.GHCR_USERNAME != ""' but we can run
  14. # a step 'if env.GHCR_USERNAME' != ""', so we copy these to succinctly test whether
  15. # credentials have been provided before trying to run steps that need them.
  16. TARGET_SHA: ${{ github.event.client_payload.slash_command.args.named.sha }}
  17. GHCR_USERNAME: ${{ github.actor }}
  18. GCP_SERVICE_ACCOUNT_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY}}
  19. GCP_FED_REGION: ${{ secrets.GCP_FED_REGION}}
  20. GCP_GSA_NAME: ${{ secrets.GCP_GSA_NAME}} # Google Service Account
  21. GCP_KSA_NAME: ${{ secrets.GCP_KSA_NAME}} # Kubernetes Service Account
  22. GCP_FED_PROJECT_ID: ${{ secrets.GCP_FED_PROJECT_ID}}
  23. AWS_REGION: "eu-central-1"
  24. AWS_OIDC_ROLE_ARN: ${{ secrets.AWS_OIDC_ROLE_ARN }}
  25. AWS_SA_NAME: ${{ secrets.AWS_SA_NAME }}
  26. AWS_SA_NAMESPACE: ${{ secrets.AWS_SA_NAMESPACE }}
  27. TFC_AZURE_CLIENT_ID: ${{ secrets.TFC_AZURE_CLIENT_ID}}
  28. TFC_AZURE_CLIENT_SECRET: ${{ secrets.TFC_AZURE_CLIENT_SECRET }}
  29. TFC_AZURE_TENANT_ID: ${{ secrets.TFC_AZURE_TENANT_ID}}
  30. TFC_AZURE_SUBSCRIPTION_ID: ${{ secrets.TFC_AZURE_SUBSCRIPTION_ID }}
  31. TFC_VAULT_URL: ${{ secrets.TFC_VAULT_URL}}
  32. SCALEWAY_API_URL: ${{ secrets.SCALEWAY_API_URL }}
  33. SCALEWAY_REGION: ${{ secrets.SCALEWAY_REGION }}
  34. SCALEWAY_PROJECT_ID: ${{ secrets.SCALEWAY_PROJECT_ID }}
  35. SCALEWAY_ACCESS_KEY: ${{ secrets.SCALEWAY_ACCESS_KEY }}
  36. SCALEWAY_SECRET_KEY: ${{ secrets.SCALEWAY_SECRET_KEY }}
  37. DELINEA_TLD: ${{ secrets.DELINEA_TLD }}
  38. DELINEA_URL_TEMPLATE: ${{ secrets.DELINEA_URL_TEMPLATE }}
  39. DELINEA_TENANT: ${{ secrets.DELINEA_TENANT }}
  40. DELINEA_CLIENT_ID: ${{ secrets.DELINEA_CLIENT_ID }}
  41. DELINEA_CLIENT_SECRET: ${{ secrets.DELINEA_CLIENT_SECRET }}
  42. SECRETSERVER_USERNAME: ${{ secrets.SECRETSERVER_USERNAME }}
  43. SECRETSERVER_PASSWORD: ${{ secrets.SECRETSERVER_PASSWORD }}
  44. SECRETSERVER_URL: ${{ secrets.SECRETSERVER_URL }}
  45. GRAFANA_URL: ${{ secrets.GRAFANA_URL }}
  46. GRAFANA_TOKEN: ${{ secrets.GRAFANA_TOKEN }}
  47. jobs:
  48. integration-trusted:
  49. name: integration-trusted (${{ matrix.suite.name }})
  50. runs-on: ubuntu-latest
  51. strategy:
  52. fail-fast: false
  53. matrix:
  54. suite:
  55. - name: classic
  56. make_target: test.e2e
  57. allow_failure: false
  58. - name: v2
  59. make_target: test.e2e.v2
  60. allow_failure: true
  61. continue-on-error: ${{ matrix.suite.allow_failure }}
  62. permissions:
  63. id-token: write #for oidc auth with aws/gcp/azure
  64. contents: read #for checkout
  65. if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor !='dependabot[bot]'
  66. steps:
  67. - uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
  68. with:
  69. egress-policy: audit
  70. - name: Branch based PR checkout
  71. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  72. - name: Fetch History
  73. run: git fetch --prune --unshallow
  74. - uses: ./.github/actions/e2e
  75. with:
  76. make-target: ${{ matrix.suite.make_target }}
  77. # Repo owner has commented /ok-to-test on a (fork-based) pull request
  78. integration-fork:
  79. name: integration-fork (${{ matrix.suite.name }})
  80. runs-on: ubuntu-latest
  81. strategy:
  82. fail-fast: false
  83. matrix:
  84. suite:
  85. - name: classic
  86. make_target: test.e2e
  87. allow_failure: false
  88. - name: v2
  89. make_target: test.e2e.v2
  90. allow_failure: true
  91. continue-on-error: ${{ matrix.suite.allow_failure }}
  92. permissions:
  93. id-token: write #for oidc auth with aws/gcp/azure
  94. contents: read #for checkout
  95. pull-requests: write # to publish the status as comments
  96. if: github.event_name == 'repository_dispatch'
  97. steps:
  98. - uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
  99. with:
  100. egress-policy: audit
  101. # Check out merge commit
  102. - name: Fork based /ok-to-test checkout
  103. uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
  104. with:
  105. ref: '${{ env.TARGET_SHA }}'
  106. - name: Fetch History
  107. run: git fetch --prune --unshallow
  108. - id: e2e
  109. uses: ./.github/actions/e2e
  110. with:
  111. make-target: ${{ matrix.suite.make_target }}
  112. - id: create_token
  113. if: always() && matrix.suite.name == 'classic'
  114. uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
  115. with:
  116. app-id: ${{ secrets.APP_ID }}
  117. private-key: ${{ secrets.PRIVATE_KEY }}
  118. owner: ${{ github.repository_owner }}
  119. - name: Update on Succeess
  120. if: always() && matrix.suite.name == 'classic' && steps.e2e.conclusion == 'success'
  121. uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
  122. with:
  123. token: ${{ steps.create_token.outputs.token }}
  124. issue-number: ${{ github.event.client_payload.pull_request.number }}
  125. body: |
  126. [Bot] - :white_check_mark: [e2e for ${{ env.TARGET_SHA }} passed](https://github.com/external-secrets/external-secrets/actions/runs/${{ github.run_id }})
  127. - name: Update on Failure
  128. if: always() && matrix.suite.name == 'classic' && steps.e2e.conclusion != 'success'
  129. uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
  130. with:
  131. token: ${{ steps.create_token.outputs.token }}
  132. issue-number: ${{ github.event.client_payload.pull_request.number }}
  133. body: |
  134. [Bot] - :x: [e2e for ${{ env.TARGET_SHA }} failed](https://github.com/external-secrets/external-secrets/actions/runs/${{ github.run_id }})