forked from nounsDAO/nouns-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (117 loc) · 3.21 KB
/
node.yaml
File metadata and controls
122 lines (117 loc) · 3.21 KB
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: Node.js CI Pipeline
on:
push:
branches:
- master
- develop
- 'feature/*'
- 'bugfix/*'
- 'release/*'
- 'hotfix/*'
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
concurrency:
group: ci-pipeline-${{ github.ref }}-node-${{ matrix.node-version }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
node-version: &node-version [22.x]
steps:
- &checkout-step
name: Checkout repo
uses: actions/checkout@v5
- &setup-pnpm-step
name: Setup pnpm
uses: pnpm/action-setup@v4
- &setup-node-step
name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- &turbo-cache-step
name: Restore turbo cache
uses: actions/cache@v4
with:
path: |
.turbo
packages/**/.turbo
key: ${{ runner.os }}-turbo-${{ hashFiles('**/turbo.json') }}
- &install-deps-step
name: Install deps
env:
NODE_OPTIONS: --max-old-space-size=4096
run: pnpm install --frozen-lockfile
- name: Build packages
run: pnpm build
- name: Netlify build
run: pnpm netlify build --offline --filter packages/nouns-webapp
test:
name: Test
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: *node-version
steps:
- *checkout-step
- *setup-pnpm-step
- *setup-node-step
- *turbo-cache-step
- *install-deps-step
- name: Run tests
run: pnpm test
lint:
name: Lint
if: github.event_name == 'pull_request'
needs: build
runs-on: ubuntu-latest
steps:
- *checkout-step
- *setup-pnpm-step
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: pnpm
- *turbo-cache-step
- *install-deps-step
- name: Build packages
run: pnpm build
- name: Lint changed files
run: |
echo "::add-matcher::.github/eslint-matcher.json"
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
git fetch origin $BASE_SHA $HEAD_SHA
FILES=$(git diff --name-only --diff-filter=d "$BASE_SHA"..."$HEAD_SHA" -- '*.ts' '*.tsx' '*.js' '*.jsx')
[ -z "$FILES" ] && echo 'no JS/TS changes' && exit 0
pnpm lint $FILES
translations:
name: Check for missing translations
if: github.event_name == 'pull_request'
needs: build
runs-on: ubuntu-latest
steps:
- *checkout-step
- *setup-pnpm-step
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: pnpm
- *turbo-cache-step
- *install-deps-step
- name: Build packages
run: pnpm build
- name: Check for missing translations
run: |
pnpm --filter @nouns/webapp -- i18n:extract
pnpm --filter @nouns/webapp -- i18n:compile --strict