-
Notifications
You must be signed in to change notification settings - Fork 136
73 lines (71 loc) · 2.44 KB
/
e2e-next-example.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: E2E Test Packages (Legacy)
on:
pull_request:
paths-ignore:
- '**/*.md'
jobs:
e2e-test-next-getting-started-example:
name: (legacy) Next Getting Started Example on Node ${{ matrix.node }}
runs-on: ubuntu-22.04
env:
PR_REPO: ${{github.event.pull_request.head.repo.full_name}}
PR_BRANCH: ${{github.event.pull_request.head.ref}}
strategy:
matrix:
node: ['18', '20']
defaults:
run:
working-directory: ./
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
# Get the PR branch so we can pull the correct Next.js example path
- name: echo current pr branch name
run: |
echo $PR_BRANCH
# Get the PR repo so we can pull the correct Next.js example path
- name: echo current pr repo
run: |
echo $PR_REPO
# Install the Faust.js Next getting started example via npx create next app
# and use the PR branch to pull the correct example URL
- name: npx create next app
run: |
npx create-next-app@13 \
-e https://github.com/${PR_REPO}/tree/${PR_BRANCH} \
--example-path examples/next/getting-started \
--use-npm \
e2e-app
- name: install and build packages
working-directory: ./
run: |
npm ci
npm run build
# To ensure PR changes are tested accurately, we replace the
# faust node_modules downloaded from NPM with the faust packages
# built in the previous step
# TODO: It would be nice to use symlink or npm link here, but upon
# writing this they do not function as expected on GH actions
- name: replace downloaded registry faust packages with local build
run: |
rm -rf e2e-app/node_modules/@faustjs/core
rm -rf e2e-app/node_modules/@faustjs/next
cp -r packages/core e2e-app/node_modules/@faustjs/core
cp -r packages/next e2e-app/node_modules/@faustjs/next
- name: copy env
working-directory: e2e-app
run: |
cp .env.local.sample .env.local
# Generate the schema to ensure no type collisions
- name: Generate Schema
working-directory: e2e-app
run: |
npm run generate
- name: Build
working-directory: e2e-app
run: |
npm run build