-
-
Notifications
You must be signed in to change notification settings - Fork 236
48 lines (43 loc) · 1.43 KB
/
main.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
name: main
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build, lint, and test
runs-on: macos-15
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
steps:
# General setup
- uses: actions/checkout@v4
with:
fetch-depth: 0 # For Turborepo
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'
- run: pnpm install
# Next.js caching
- uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/examples/*/.next/cache
${{ github.workspace }}/docs/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}
# Playwright (incl. caching)
- id: playwright-version
run: |
version=$(pnpm --filter example-app-router exec playwright --version | awk '{print $2}')
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
- run: pnpm --filter example-app-router exec playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
# Main tasks
- run: pnpm turbo run lint build test size --affected