-
-
Notifications
You must be signed in to change notification settings - Fork 8
115 lines (101 loc) · 3.39 KB
/
ci-apps-web.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
---
on: # yamllint disable-line rule:truthy
pull_request:
types:
- opened
- synchronize
- reopened
# Only consider those paths to trigger the action
paths:
- 'apps/web/**'
- 'packages/**'
- 'package.json'
- 'pnpm*'
- '.github/**'
- 'tsconfig.base.json'
name: 🔍 Continuous integration for web app
jobs:
integration:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-latest']
node: ['18']
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_TEAM: 'next-starter-tpl'
TURBO_TOKEN: 'local_server_turbo_relaxed_token'
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: ⚙️ Setup node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org/'
- name: 🚀 Setup TurboRepo local server
uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ env.TURBO_TOKEN }}
- name: 📥 Monorepo install
uses: wayofdev/gh-actions/actions/pnpm-install@master
with:
enable-corepack: true
cache-node-modules: true
# see https://github.com/vercel/next.js/pull/27362
- name: ♻️ Restore "web" app build from cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/apps/web/.next/cache
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
key: web-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: 📝 Typecheck
working-directory: apps/web
run: |
pnpm lint:types
- name: 🚨 Linter
working-directory: apps/web
run: |
pnpm lint
- name: 🧪 Unit tests
working-directory: apps/web
run: |
pnpm test
- name: 🏗 Build web-app
working-directory: apps/web
run: |
pnpm --filter=web build
env:
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: secret-string-only-for-ci
APP_CACHE_DSN: ''
# Speed up build: they are linted in a previous step
NEXT_IGNORE_ESLINT: true
# Speed up build: they are type-checked in a previous step
NEXT_IGNORE_TYPE_CHECK: true
# Speed up build: don't run if not needed, enable if it becomes needed
NEXT_DISABLE_SOURCEMAPS: true
# Don't send telemetry for ci
NEXT_TELEMETRY_DISABLED: true
# To allow checking size-limits
DISABLE_SENTRY: false
# Fully disable sentry upload
SENTRY_UPLOAD_DRY_RUN: true
- name: 📉 Check browser bundle size limits
working-directory: apps/web
run: |
pnpm --filter=web lint:size
- name: 🌎 Ecmascript checks for build files
working-directory: apps/web
run: |
pnpm --filter=web lint:dist
- name: 📤 Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./apps/web/coverage/coverage-final.json
flags: web