Skip to content

Commit c2f86f4

Browse files
committed
chore(e2e): Add e2e-local action to check workflow
fix order refactor check workflow order fs-dev-nextMode for experimental refactor env variable
1 parent fe913bb commit c2f86f4

File tree

16 files changed

+131
-38
lines changed

16 files changed

+131
-38
lines changed

.github/actions/lint/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ description: Run biome to lint codebase and ensure code quality
44
runs:
55
using: "composite"
66
steps:
7-
- name: Install dependencies
8-
run: pnpm install
9-
shell: bash
10-
117
- name: Setup Biome CLI
128
uses: biomejs/[email protected]
139

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Install dependencies & build OpenNext package
2+
description: Installs dependencies and builds OpenNext
3+
runs:
4+
using: 'composite'
5+
steps:
6+
# Build only the @opennextjs/aws package + its monorepo dependencies
7+
- name: Build
8+
shell: bash
9+
run: pnpm --filter @opennextjs/aws... run build
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: E2E Local
2+
description: Runs E2E tests locally with development overrides
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: Setup Playwright
7+
uses: ./.github/actions/setup-playwright
8+
9+
- name: Build examples apps with local configuration
10+
shell: bash
11+
run: pnpm -r openbuild:local
12+
13+
# Remember to add more ports here if we add new examples app
14+
# We filter out app-router cause we wanna set OPEN_NEXT_REQUEST_ID_HEADER=true there
15+
- name: Start the local OpenNext servers
16+
shell: bash
17+
run: |
18+
pnpm -r openbuild:local:start &
19+
for port in 3001 3002 3003 3004; do
20+
echo "Checking port $port..."
21+
for attempt in {1..20}; do
22+
sleep 0.5
23+
if curl --silent --fail http://localhost:$port > /dev/null; then
24+
echo "Server on $port is ready"
25+
break
26+
fi
27+
if [ $attempt -eq 20 ]; then
28+
echo "Server on $port failed to start"
29+
exit 1
30+
fi
31+
echo "Waiting for server on $port, attempt $attempt..."
32+
done
33+
done
34+
- name: Run E2E Test locally
35+
shell: bash
36+
run: |
37+
pnpm e2e:test
38+
39+
## Do we want to report to Discord?
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: 'Setup Playwright'
2+
description: 'Setup Playwright with caching'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Put $HOME in env
8+
if: runner.os == 'windows'
9+
shell: pwsh
10+
run: echo "HOME=$HOME" | Out-File -FilePath $env:GITHUB_ENV -Append
11+
12+
- name: Cache Playwright
13+
id: playwright-cache
14+
uses: actions/cache@v4
15+
with:
16+
path: ${{ runner.os == 'Windows' && format('{0}{1}', env.HOME, '\AppData\Local\ms-playwright') || runner.os == 'Linux' && '~/.cache/ms-playwright' || '~/Library/Caches/ms-playwright' }}
17+
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
18+
19+
- name: Install Playwright with dependencies
20+
if: steps.playwright-cache.outputs.cache-hit != 'true'
21+
shell: bash
22+
run: pnpm exec playwright install chromium --with-deps
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
name: Install & setup pnpm
1+
name: Install & setup
22
description: Install's node, pnpm, restores cache
33

44
runs:
55
using: 'composite'
66
steps:
7-
# Install nodejs. https://github.com/actions/setup-node
8-
- name: Setup Node.js
9-
uses: actions/setup-node@v4
10-
with:
11-
node-version: 18.x
12-
137
# Install pnpm. https://github.com/pnpm/action-setup
148
- uses: pnpm/action-setup@v4
159
with:
1610
version: 9
1711
# run_install: false
1812

13+
- name: Install Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20.19.4
17+
cache: "pnpm"
18+
registry-url: "https://registry.npmjs.org"
19+
1920
# Get pnpm store path so we can cache it
2021
- name: Get pnpm store directory
2122
shell: bash
@@ -29,3 +30,7 @@ runs:
2930
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
3031
restore-keys: |
3132
${{ runner.os }}-pnpm-store-
33+
34+
- name: Install dependencies
35+
run: pnpm install
36+
shell: bash

.github/workflows/check.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
branches:
66
- main
7+
# workflow_dispatch:
78

89
jobs:
910
validate:
@@ -14,6 +15,8 @@ jobs:
1415
steps:
1516
- name: Checkout
1617
uses: actions/checkout@v4
17-
- uses: ./.github/actions/pnpm-setup
18+
- uses: ./.github/actions/setup
1819
- uses: ./.github/actions/lint
19-
- uses: ./.github/actions/test
20+
- uses: ./.github/actions/test
21+
- uses: ./.github/actions/local/build
22+
- uses: ./.github/actions/local/e2e

.github/workflows/e2e.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,9 @@ jobs:
113113
run: pnpm add next@${{ needs.check_next_version.outputs.previousNextVersion }}
114114
# We do not install the latest canary of Next in the experimental app.
115115

116-
- name: Get Playwright version
117-
id: playwright-version
118-
run: echo "version=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//' | sed 's/ .*//' )"
119-
120-
- name: Cache Playwright
121-
uses: actions/cache@v4
122-
id: playwright-cache
123-
with:
124-
path: "~/.cache/ms-playwright"
125-
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
126-
restore-keys: |
127-
${{ runner.os }}-playwright-
128-
129-
- name: Install Playwright
130-
if: steps.playwright-cache.outputs.cache-hit != 'true'
131-
run: pnpm exec playwright install chromium --with-deps
116+
# Setup playwright
117+
- name: Setup Playwright
118+
uses: ./.github/actions/setup-playwright
132119

133120
# Cache turbo runs
134121
- name: Cache Turbo

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
registry-url: "https://registry.npmjs.org"
2626

27-
- uses: ./.github/actions/pnpm-setup
27+
- uses: ./.github/actions/setup
2828

2929
- name: Install dependencies
3030
run: pnpm install

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# https://github.com/actions/checkout
1717
uses: actions/checkout@v4
1818

19-
- uses: ./.github/actions/pnpm-setup
19+
- uses: ./.github/actions/setup
2020
- uses: ./.github/actions/lint
2121

2222
- name: Create Release Pull Request or Publish to npm

.github/workflows/v2-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
with:
1717
registry-url: "https://registry.npmjs.org"
1818

19-
- uses: ./.github/actions/pnpm-setup
19+
- uses: ./.github/actions/setup
2020

2121
- name: Install dependencies
2222
run: pnpm install

0 commit comments

Comments
 (0)