-
-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (102 loc) · 3.5 KB
/
ci-web-app.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CI Web App
on:
push:
branches: [main]
# Only consider those paths to trigger the action
paths:
- 'apps/web/**'
- 'packages/**'
- 'package.json'
- '*.lock'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.npmrc'
- 'tsconfig.base.json'
- '.prettier*'
- '.github/**'
- 'turbo.json'
pull_request:
types: [opened, synchronize, reopened]
# Only consider those paths to trigger the action
paths:
- 'apps/web/**'
- 'packages/**'
- 'package.json'
- '*.lock'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.npmrc'
- 'tsconfig.base.json'
- '.prettier*'
- '.github/**'
- 'turbo.json'
# Allows triggering this workflow from GitHub UI
workflow_dispatch:
jobs:
lint-unit-build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
node-version: [20.x]
# To use 'Remote' Caching, uncomment the next lines and follow the steps below.
# We are set up to caching using GitHub artifacts by default, but teams may wish to
# use Vercel's Remote Caching feature.
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TEAM: 'nextjs-monorepo-example'
TURBO_TOKEN: 'local_server_turbo_relaxed_token'
steps:
- name: Checkout 🛎
uses: actions/checkout@v4
# Uses the pnpm version specified in root package.json `packageManager`
- name: Setup pnpm v9 🦾
uses: pnpm/action-setup@v4
- name: Setup node v${{ matrix.node }} env 🏗
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: 'pnpm'
- name: ⏩ TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}
- name: Setup Next application 🥾
run: cp .github/apps.web.env apps/web/.env
- name: Restore Web App related caches ♻️
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/apps/web/.next/cache
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-web-app-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-web-app-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install root + src dependencies 👨🏻💻
run: pnpm install
- name: Run type checking 📚
run: pnpm g:typecheck
- name: Run linters 👀
run: pnpm g:lint
env:
TIMING: 1
- name: 🧪 Unit tests
run: pnpm g:test:unit
- name: 🏗 Build web-app
run: pnpm g:build
env:
NEXT_BUILD_ENV_ESLINT: false
NEXT_BUILD_ENV_TYPECHECK: false
NEXT_BUILD_ENV_SOURCEMAPS: false
NEXT_BUILD_ENV_SENTRY_ENABLED: true
NEXT_BUILD_ENV_SENTRY_UPLOAD_DRY_RUN: true
NEXT_TELEMETRY_DISABLED: true
#- name: 📐 Check browser bundle size limits
# run: yarn --filter "apps/web" check-size
#- name: 🛟 Check ecmascript checks for build files
# run: yarn --filter "apps/web" check-dist