-
Notifications
You must be signed in to change notification settings - Fork 49
58 lines (47 loc) · 1.41 KB
/
run-tests-build.yaml
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
name: Build Next.js Examples
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
find-packages:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.find-packages.outputs.packages }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Find Next.js packages
id: find-packages
run: |
packages=$(ls -d examples/* | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "::set-output name=packages::$packages"
echo "packages=$packages" >> $GITHUB_ENV
shell: bash
- name: Debug packages output
run: echo ${{ steps.find-packages.outputs.packages }}
build:
needs: find-packages
runs-on: ubuntu-latest
strategy:
matrix:
package: ${{ fromJson(needs.find-packages.outputs.packages) }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Ensure this matches your Node.js version
- name: Install Yarn
run: |
corepack enable
corepack prepare [email protected] --activate
- name: Install dependencies
working-directory: ${{ matrix.package }}
run: yarn install
- name: Build Next.js project
working-directory: ${{ matrix.package }}
run: yarn build