Skip to content
Snippets Groups Projects
Unverified Commit b547eb7e authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Make E2E workflow 3rd party friendly (#35643)

parent a1aebe90
No related branches found
No related tags found
No related merge requests found
......@@ -7,14 +7,31 @@ on:
- 'release-**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_run:
workflows: [External Trigger Filter]
types: [completed]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
external-filter:
if: github.event.pull_request.head.repo.full_name == github.repository || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 3
steps:
- run: |
if ${{ github.event.pull_request.head.repo.full_name == github.repository }}; then
echo 'Running E2E tests within the organization.'
elif ${{ github.event.workflow_run.conclusion == 'success' }}; then
echo "Running E2E tests for the external contributor. Thank you!"
fi
files-changed:
name: Check which files changed
needs: external-filter
if: needs.external-filter.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
......@@ -29,6 +46,8 @@ jobs:
filters: .github/file-paths.yaml
e2e-matrix-builder:
needs: external-filter
if: needs.external-filter.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
......@@ -40,9 +59,10 @@ jobs:
uses: ./.github/actions/build-e2e-matrix
build:
needs: [files-changed, e2e-matrix-builder]
needs: [files-changed, e2e-matrix-builder, external-filter]
if: |
!cancelled() &&
needs.external-filter.result == 'success' &&
github.event.pull_request.draft == false &&
needs.e2e-matrix-builder.result == 'success' &&
needs.files-changed.outputs.e2e_all == 'true'
......@@ -72,9 +92,9 @@ jobs:
name: metabase-${{ matrix.edition }}-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
e2e-tests:
needs: [build, e2e-matrix-builder]
needs: [build, e2e-matrix-builder, external-filter]
if: |
!cancelled() && needs.build.result == 'success'
!cancelled() && needs.build.result == 'success' && needs.external-filter.result == 'success'
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
name: e2e-tests-${{ matrix.name }}-${{ matrix.edition }}
......@@ -182,10 +202,10 @@ jobs:
if-no-files-found: ignore
e2e-tests-skipped-stub:
needs: [e2e-tests, e2e-matrix-builder]
needs: [e2e-tests, e2e-matrix-builder, external-filter]
if: |
!cancelled() &&
needs.e2e-tests.result == 'skipped'
needs.e2e-tests.result == 'skipped' && needs.external-filter.result == 'success'
runs-on: ${{ matrix.runner }}
timeout-minutes: 5
name: e2e-tests-${{ matrix.name }}-${{ matrix.edition }}
......@@ -199,9 +219,9 @@ jobs:
visual-regression-tests:
runs-on: ubuntu-22.04
timeout-minutes: 60
needs: [build]
needs: [build, external-filter]
if: |
!cancelled() && needs.build.result == 'success'
!cancelled() && needs.build.result == 'success' && needs.external-filter.result == 'success'
name: percy-visual-regression-tests
steps:
- uses: actions/checkout@v3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment