-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: E2E / Playwright Tests | ||
on: | ||
push: | ||
branches: [main, next] | ||
paths: | ||
- "aksel.nav.no/**" | ||
pull_request: | ||
branches: [main, next] | ||
paths: | ||
- "aksel.nav.no/**" | ||
|
||
jobs: | ||
build_and_start_website: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup and build Next.js application | ||
uses: ./.github/actions/build-website | ||
with: | ||
use_cdn_assets: false | ||
npm_auth_token: ${{ secrets.READER_TOKEN }} | ||
nais_id_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | ||
nais_project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | ||
sanity_read_token: ${{ secrets.SANITY_READ }} | ||
sanity_read_no_drafts_token: ${{ secrets.SANITY_READ_NO_DRAFTS }} | ||
|
||
- name: Start App | ||
run: yarn serve:next | ||
|
||
playwright: | ||
needs: build_and_start_website | ||
runs-on: ubuntu-latest | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.48.1-jammy | ||
strategy: | ||
matrix: | ||
shard: [1, 2, 3, 4] # Example for 2 shards | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Playwright tests | ||
run: yarn workspace website run yarn generate-testpaths | ||
env: | ||
SANITY_READ: ${{ secrets.SANITY_READ }} | ||
SANITY_READ_NO_DRAFTS: ${{ secrets.SANITY_READ_NO_DRAFTS }} | ||
|
||
- name: Run Playwright Tests | ||
run: yarn workspace website run yarn playwright --shard ${{ matrix.shard }}/4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters