mirror of
https://github.com/1Password/onepassword-operator.git
synced 2025-10-21 23:18:06 +00:00
Add workflow to run e2e tests on contributor's branch
This commit is contained in:
57
.github/workflows/test-e2e-fork.yml
vendored
Normal file
57
.github/workflows/test-e2e-fork.yml
vendored
Normal file
@@ -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 }}
|
Reference in New Issue
Block a user