-
Notifications
You must be signed in to change notification settings - Fork 1
181 lines (181 loc) · 6.21 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
name: ci
on:
push:
branches:
- master
jobs:
build:
name: Test on node ${{matrix.node}} and ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
node:
- 20
- 22
os:
#- macos-latest
- ubuntu-latest
#- windows-latest
env:
#PLAYWRIGHT_BROWSERS_PATH: ./cache/playwright
YARN_NODE_LINKER: pnp
steps:
- name: Checkout
uses: actions/[email protected]
# with:
# lfs: true
- name: Git LFS Hashes
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-hashes
- name: Restore Git LFS Cache
uses: actions/[email protected]
id: lfs-cache
with:
path: .git/lfs
key: ${{matrix.os}}-lfs-${{hashFiles('.lfs-hashes')}}
restore-keys: |
${{matrix.os}}-lfs-
- name: Pull Git LFS
run: git lfs pull
- name: Setup Node@${{matrix.node}}
uses: actions/[email protected]
with:
node-version: ${{matrix.node}}
- name: Yarn Cache Directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Restore Yarn Cache
uses: actions/[email protected]
id: yarn-cache
with:
path: |
${{steps.yarn-cache-dir-path.outputs.dir}}
.yarn/install-state.gz
.yarn/unplugged
key: ${{matrix.os}}-${{matrix.node}}-yarn-${{hashFiles('**/yarn.lock')}}
restore-keys: |
${{matrix.os}}-${{matrix.node}}-yarn-
- name: Install Dependencies
run: yarn install --immutable
- name: Constraints
run: yarn constraints
- name: Restore TypeScript Cache
uses: actions/[email protected]
id: typescript-cache
with:
path: "**/build"
key: ${{matrix.os}}-${{matrix.node}}-typescript-${{github.sha}}
restore-keys: |
${{matrix.os}}-${{matrix.node}}-typescript-
- name: Compile
run: yarn workspaces foreach --all --parallel --topological-dev --verbose run compile
- name: Restore Jest Cache
uses: actions/[email protected]
id: jest-cache
with:
path: "**/cache/jest"
key: ${{matrix.os}}-${{matrix.node}}-jest-${{github.sha}}
restore-keys: |
${{matrix.os}}-${{matrix.node}}-jest-
- name: Unit Test
run: yarn workspaces foreach --all --parallel --verbose run test:ci
- name: Restore ESLint Cache
uses: actions/[email protected]
id: eslint-cache
with:
path: "**/.eslintcache"
key: ${{matrix.os}}-${{matrix.node}}-eslint-${{github.sha}}
restore-keys: |
${{matrix.os}}-${{matrix.node}}-eslint-
- name: Lint
run: yarn workspaces foreach --all --parallel --verbose run lint:all
- name: Restore Prettier Cache
uses: actions/[email protected]
id: prettier-cache
with:
path: "**/.yarn/.cache/prettier"
key: ${{matrix.os}}-${{matrix.node}}-prettier-${{github.sha}}
restore-keys: |
${{matrix.os}}-${{matrix.node}}-prettier-
- name: Format
run: yarn workspaces foreach --all --parallel --verbose run format:all:check
- name: Restore Webpack Cache
uses: actions/[email protected]
id: webpack-cache
with:
path: "**/.yarn/.cache/webpack"
key: ${{matrix.os}}-${{matrix.node}}-webpack-${{github.sha}}
restore-keys: |
${{matrix.os}}-${{matrix.node}}-webpack-
- name: Build
run: yarn workspaces foreach --all --parallel --topological-dev --verbose run build
- name: Bundle Size
run: yarn workspaces foreach --all --parallel --verbose run bundlesize
#- name: Date (YYYYMM)
# id: date
# run: echo "::set-output name=date::$(/bin/date -u "+%Y%m")"
#- name: Restore Playwright Cache
# uses: actions/[email protected]
# id: playwright-cache
# with:
# path: ${{env.PLAYWRIGHT_BROWSERS_PATH}}
# key: ${{matrix.os}}-${{matrix.node}}-playwright-${{steps.date.outputs.date}}
- name: Playwright
id: playwright
run: |
yarn dlx playwright install --with-deps
yarn workspaces foreach --all --parallel --verbose run playwright
- name: Upload Playwright Artifacts
uses: actions/[email protected]
if: steps.playwright.outcome == 'failure'
with:
name: ${{matrix.os}}-${{matrix.node}}-playwright
path: ${{github.workspace}}/**/playwright/report/
retention-days: 5
timeout-minutes: 15
# # https://help.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages
# publish:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/[email protected]
# # with:
# # lfs: true
# - name: Git LFS Hashes
# run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-hashes
# - name: Restore Git LFS Cache
# uses: actions/[email protected]
# id: lfs-cache
# with:
# path: .git/lfs
# key: ${{runner.os}}-lfs-${{hashFiles('.lfs-hashes')}}
# restore-keys: |
# ${{runner.os}}-lfs-
# - name: Pull Git LFS
# run: git lfs pull
# - name: Setup Node
# uses: actions/[email protected]
# with:
# node-version-file: .nvmrc
# registry-url: "https://registry.npmjs.org"
# - name: Yarn Cache Directory
# id: yarn-cache-dir-path
# run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
# - name: Restore Yarn Cache
# uses: actions/[email protected]
# id: yarn-cache
# with:
# path: |
# ${{steps.yarn-cache-dir-path.outputs.dir}}
# .yarn/install-state.gz
# .yarn/unplugged
# key: ${{runner.os}}-${{matrix.node}}-yarn-${{hashFiles('**/yarn.lock')}}
# restore-keys: |
# ${{runner.os}}-${{matrix.node}}-yarn-
# - name: Install Dependencies
# run: yarn install --immutable
# - name: Publish
# run: yarn publish
# env:
# NODE_AUTH_TOKEN: ${{secrets.npm_token}}
# timeout-minutes: 15