Skip to content

Commit

Permalink
test(e2e): Run required E2E tests on PRs from forks (#12791)
Browse files Browse the repository at this point in the history
Enable running E2E tests on PRs opened from forked
repositories. Previously we excluded these because some E2E tests
required secrets which are not available in the forks, causing e2e test
runs to always fail. Now that we separated these tests from the e2e
tests that don't require secrets
(#12259) we should be
good to re-enable the required e2e tests for external PRs.
  • Loading branch information
Lms24 authored Jul 8, 2024
1 parent 2e3ae56 commit aded253
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,7 @@ jobs:
# - AND if the profiling node bindings were either successful or skipped
if: |
always() && needs.job_build.result == 'success' &&
(needs.job_compile_bindings_profiling_node.result == 'success' || needs.job_compile_bindings_profiling_node.result == 'skipped') &&
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
(needs.job_compile_bindings_profiling_node.result == 'success' || needs.job_compile_bindings_profiling_node.result == 'skipped')
needs: [job_get_metadata, job_build, job_compile_bindings_profiling_node]
runs-on: ubuntu-20.04-large-js
timeout-minutes: 15
Expand Down Expand Up @@ -996,7 +995,6 @@ jobs:
'angular-17',
'angular-18',
'aws-lambda-layer-cjs',
'cloudflare-astro',
'node-express',
'create-react-app',
'create-next-app',
Expand Down Expand Up @@ -1114,16 +1112,6 @@ jobs:
timeout-minutes: 5
run: pnpm test:assert

- name: Deploy Astro to Cloudflare
uses: cloudflare/pages-action@v1
if: matrix.test-application == 'cloudflare-astro'
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: dist
workingDirectory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}

job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
Expand All @@ -1149,6 +1137,7 @@ jobs:
matrix:
test-application:
[
'cloudflare-astro',
'react-send-to-sentry',
'node-express-send-to-sentry',
'debug-id-sourcemaps',
Expand Down Expand Up @@ -1215,6 +1204,16 @@ jobs:
timeout-minutes: 5
run: pnpm ${{ matrix.assert-command || 'test:assert' }}

- name: Deploy Astro to Cloudflare
uses: cloudflare/pages-action@v1
if: matrix.test-application == 'cloudflare-astro'
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: dist
workingDirectory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}

job_profiling_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
Expand Down

0 comments on commit aded253

Please sign in to comment.