From 460742869b4a34b401f480d4f267f22c0ca9e527 Mon Sep 17 00:00:00 2001 From: Volodymyr Zotov Date: Thu, 11 Sep 2025 11:14:10 -0500 Subject: [PATCH] Add workflow to run e2e tests on contributor's branch --- .github/workflows/test-e2e-fork.yml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/test-e2e-fork.yml diff --git a/.github/workflows/test-e2e-fork.yml b/.github/workflows/test-e2e-fork.yml new file mode 100644 index 0000000..cc86473 --- /dev/null +++ b/.github/workflows/test-e2e-fork.yml @@ -0,0 +1,57 @@ +name: Run Test E2E tests [fork] + +on: + repository_dispatch: + types: [ ok-to-test-command ] + +permissions: + contents: read + +concurrency: + group: e2e-fork-${{ github.event.client_payload.pull_request.number || github.run_id }} + cancel-in-progress: true # cancel previous job runs for the same branch + +jobs: + run-e2e-tests: + name: E2E (fork) + runs-on: ubuntu-latest + if: | + github.event_name == 'repository_dispatch' && + github.event.client_payload.slash_command.args.named.sha != '' && + contains( + github.event.client_payload.pull_request.head.sha, + github.event.client_payload.slash_command.args.named.sha + ) + steps: + - uses: actions/checkout@v5 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version-file: go.mod + + - name: Install dependencies + run: go mod tidy + + - name: Create kind cluster + uses: helm/kind-action@v1 + with: + cluster_name: onepassword-operator-test-e2e + + # Install 1Password CLI to support testhelper/op usage + - name: Install 1Password CLI + uses: 1password/install-cli-action@v2 + with: + version: 2.32.0 + + - name: Create '1password-credentials.json' file + env: + OP_CONNECT_CREDENTIALS: ${{ secrets.OP_CONNECT_CREDENTIALS }} + run: | + echo "$OP_CONNECT_CREDENTIALS" > 1password-credentials.json + + - name: Run E2E tests + run: make test-e2e + env: + OP_CONNECT_TOKEN: ${{ secrets.OP_CONNECT_TOKEN }} + OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} \ No newline at end of file