-
Notifications
You must be signed in to change notification settings - Fork 5
223 lines (187 loc) · 6.77 KB
/
ci.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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: 'CI: TS-Check & Test'
on:
push:
paths:
- 'source/src/**'
- 'examples/src/**/*.spec.ts'
- 'examples/src/**/*.page.tsx'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
# Install & caches "fresh" node_modules
# npm-install:
# name: Install npm deps
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [20.x]
# steps:
# - uses: actions/checkout@v4
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# cache: 'npm'
# cache-dependency-path: |
# package-lock.json
# source/package-lock.json
# examples/package-lock.json
# www/package-lock.json
# - name: Cache node_modules for root
# id: cache-node-modules-root
# uses: actions/cache@v3
# with:
# path: node_modules
# key: node-modules-root-${{ github.run_id }}
# - name: Cache node_modules for source
# id: cache-node-modules-source
# uses: actions/cache@v3
# with:
# path: source/node_modules
# key: node-modules-source-${{ github.run_id }}
# - name: Cache node_modules for examples
# id: cache-node-modules-examples
# uses: actions/cache@v3
# with:
# path: examples/node_modules
# key: node-modules-examples-${{ github.run_id }}
# - name: Cache node_modules for www
# id: cache-node-modules-www
# uses: actions/cache@v3
# with:
# path: www/node_modules
# key: node-modules-www-${{ github.run_id }}
# - name: Cache node_modules for www/dataserver
# id: cache-node-modules-www-dataserver
# uses: actions/cache@v3
# with:
# path: www/dataserver/node_modules
# key: node-modules-www-dataserver-${{ github.run_id }}
# - name: Execute 'npm ci' in monorepo
# run: npm ci
# - name: Execute 'npm i' in www/dataserver
# run: npm run www-dataserver:install
# - name: Get installed Playwright version
# id: playwright-version
# run: echo "::set-output name=version::$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')"
# working-directory: examples
# - name: Cache browser binaries for Playwright
# id: playwright-cache
# uses: actions/cache@v3
# with:
# path: '~/.cache/ms-playwright'
# key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
# Compiles all TS files in the monorepo
ts-check:
# needs: npm-install
name: Compile source code
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Execute 'npm ci' in monorepo
run: npm ci
- name: Execute 'npm i' in www/dataserver
run: npm run www-dataserver:install
# - name: Load cached node_modules for root
# id: cache-node-modules-root
# uses: actions/cache@v3
# with:
# path: node_modules
# key: node-modules-root-${{ github.run_id }}
# - name: Load cached node_modules for source
# id: cache-node-modules-source
# uses: actions/cache@v3
# with:
# path: source/node_modules
# key: node-modules-source-${{ github.run_id }}
# - name: Load cached node_modules for examples
# id: cache-node-modules-examples
# uses: actions/cache@v3
# with:
# path: examples/node_modules
# key: node-modules-examples-${{ github.run_id }}
# - name: Load cached node_modules for www
# id: cache-node-modules-www
# uses: actions/cache@v3
# with:
# path: www/node_modules
# key: node-modules-www-${{ github.run_id }}
# - name: Load cached node_modules for www/dataserver
# id: cache-node-modules-www-dataserver
# uses: actions/cache@v3
# with:
# path: www/dataserver/node_modules
# key: node-modules-www-dataserver-${{ github.run_id }}
- name: Compile source code in monorepo
run: npm run ci:ts-check
run-tests:
# needs: npm-install
name: Run tests
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_BASE_URL: https://infinite-table.com/.netlify/functions/json-server
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Execute 'npm ci' in monorepo
run: npm ci
- name: Execute 'npm i' in www/dataserver
run: npm run www-dataserver:install
- name: Get installed Playwright version
id: playwright-version
run: echo "::set-output name=version::$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')"
working-directory: examples
- name: Cache browser binaries for Playwright
id: playwright-cache
uses: actions/cache@v3
with:
path: '~/.cache/ms-playwright'
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
# - name: Load cached node_modules for root
# id: cache-node-modules-root
# uses: actions/cache@v3
# with:
# path: node_modules
# key: node-modules-root-${{ github.run_id }}
# - name: Load cached node_modules for source
# id: cache-node-modules-source
# uses: actions/cache@v3
# with:
# path: source/node_modules
# key: node-modules-source-${{ github.run_id }}
# - name: Load cached node_modules for examples
# id: cache-node-modules-examples
# uses: actions/cache@v3
# with:
# path: examples/node_modules
# key: node-modules-examples-${{ github.run_id }}
# - name: Get installed Playwright version
# id: playwright-version
# run: echo "::set-output name=version::$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')"
# working-directory: examples
# - name: Load cached browser binaries for Playwright
# id: playwright-cache
# uses: actions/cache@v3
# with:
# path: '~/.cache/ms-playwright'
# key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
- name: Build test app
run: npm run ci:test:build
- name: Running Playwright Tests
run: npm run ci:test:run
env:
NEXT_PUBLIC_ADAPTABLE_LICENSE_KEY: ${{ secrets.NEXT_PUBLIC_ADAPTABLE_LICENSE_KEY }}