-
Notifications
You must be signed in to change notification settings - Fork 7
188 lines (158 loc) · 5.51 KB
/
ci.yml
File metadata and controls
188 lines (158 loc) · 5.51 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: &node-versions [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- run: pnpm install --frozen-lockfile
- run: node ./scripts/generate-ajv-validator.js
- run: pnpm tsc -b tsconfig.json
- run: pnpm ci-lint
- name: Check for uncommitted changes
run: ./scripts/assert-clean-working-directory.sh
- name: Create workspace archive
run: |
tar --exclude='./node_modules' \
--exclude='./**/node_modules' \
--exclude='./.git' \
--exclude='./coverage' \
--exclude='./**/*.log' \
-cvf ${{ runner.temp }}/workspace.tar .
- name: Upload workspace
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: workspace-${{ matrix.node-version }}
path: ${{ runner.temp }}/workspace.tar
retention-days: 7
build-docs:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [24.x]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: nextjs-cache
with:
path: packages/documentation/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-
- name: Download built workspace
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @nahkies/openapi-code-generator-documentation build
unit:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: *node-versions
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- name: Download built workspace
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: pnpm run ci-test
- name: Check for uncommitted changes
run: ./scripts/assert-clean-working-directory.sh
integration:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: *node-versions
schema-builder: [joi, zod-v3, zod-v4]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- name: Download built workspace
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: pnpm integration:clean
- run: pnpm integration:generate --schema-builder ${{ matrix.schema-builder }}
- run: pnpm integration:validate
- name: Check for uncommitted changes
if: ${{ matrix.schema-builder == 'zod-v4' }}
run: ./scripts/assert-clean-working-directory.sh
e2e:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: *node-versions
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
- name: setup
uses: ./.github/actions/setup-node-pnpm
with:
node-version: ${{ matrix.node-version }}
- name: Download built workspace
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: workspace-${{ matrix.node-version }}
path: ${{runner.temp}}
- name: Extract workspace
run: |
tar -xf ${{runner.temp}}/workspace.tar -C .
- run: pnpm install --frozen-lockfile
- run: SCHEMA_BUILDER=zod-v3 pnpm e2e:generate
- run: pnpm e2e:validate
- run: SCHEMA_BUILDER=zod-v4 pnpm e2e:generate
- run: pnpm e2e:validate
- name: Check for uncommitted changes
run: ./scripts/assert-clean-working-directory.sh