Skip to content

Commit 56625ad

Browse files
committed
feat: build runtime separately
1 parent 99ace10 commit 56625ad

File tree

1 file changed

+42
-18
lines changed

1 file changed

+42
-18
lines changed

.github/workflows/test-e2e.yml

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
workflow_dispatch:
55

66
env:
7+
NODE_ENV: production
78
NODE_VERSION: 18.16.1
89
PNPM_VERSION: 8.7.1
910
NEXT_VERSION: v13.5.1-netlify
@@ -15,8 +16,40 @@ env:
1516
NETLIFY_SITE_ID: 1d5a5c76-d445-4ae5-b694-b0d3f2e2c395
1617

1718
jobs:
19+
build-runtime:
20+
name: build runtime
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: checkout repo
24+
uses: actions/checkout@v3
25+
26+
- name: setup node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: ${{ env.NODE_VERSION }}
30+
31+
- name: cache dependencies
32+
uses: actions/cache@v3
33+
with:
34+
path: node_modules
35+
key: cache-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
36+
restore-keys: |
37+
cache-${{ env.NODE_VERSION }}-
38+
39+
- name: install runtime
40+
run: npm install
41+
42+
- name: build runtime
43+
run: npm run build
44+
45+
- name: upload runtime
46+
uses: actions/upload-artifact@v3
47+
with:
48+
path: '**'
49+
1850
test-e2e:
1951
name: test e2e
52+
needs: [build-runtime]
2053
runs-on: ubuntu-latest
2154
timeout-minutes: 25
2255
strategy:
@@ -26,7 +59,7 @@ jobs:
2659
steps:
2760
- name: get github token
2861
uses: navikt/github-app-token-generator@v1
29-
id: get-token
62+
id: token
3063
with:
3164
private-key: ${{ secrets.TOKENS_PRIVATE_KEY }}
3265
app-id: ${{ secrets.TOKENS_APP_ID }}
@@ -36,14 +69,9 @@ jobs:
3669
uses: actions/checkout@v3
3770
with:
3871
repository: ${{ env.NEXT_REPO }}
39-
token: ${{ steps.get-token.outputs.token }}
72+
token: ${{ steps.token.outputs.token }}
4073
ref: ${{ env.NEXT_VERSION }}
4174

42-
- name: checkout runtime repo
43-
uses: actions/checkout@v3
44-
with:
45-
path: packages/next-runtime
46-
4775
- name: setup pnpm
4876
uses: pnpm/action-setup@v2
4977
with:
@@ -55,20 +83,16 @@ jobs:
5583
node-version: ${{ env.NODE_VERSION }}
5684
cache: pnpm
5785

58-
# - name: enable yarn support
59-
# run: corepack enable yarn
60-
61-
- name: install
62-
run: pnpm install --no-frozen-lockfile
86+
- name: install next
87+
run: pnpm install
6388

64-
- name: build
89+
- name: build next
6590
run: pnpm build
6691

67-
# - name: install playwright deps
68-
# run: pnpm playwright install-deps
69-
70-
# - name: install chromium
71-
# run: pnpm playwright install chromium
92+
- name: download next runtime
93+
uses: actions/download-artifact@v3
94+
with:
95+
path: packages/next-runtime
7296

7397
- name: add netlify cli
7498
run: pnpm add -g netlify-cli

0 commit comments

Comments
 (0)