-
Notifications
You must be signed in to change notification settings - Fork 22
224 lines (192 loc) · 6.8 KB
/
build.yaml
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
224
#
# Builds and tests the packages. This builds on Linux by default, but
# can be configured to build on Windows and/or macOS by uncommenting
# the matrix config lines below.
#
# This runs after changes are pushed to a feature branch. It does not
# run for pushes to the main branch because that is covered by the
# `release` workflow.
#
name: Build
on:
push:
branches-ignore:
- main
env:
EM_DIR: 'emsdk'
EM_VERSION: 2.0.34
# This is an additional key that can be used to invalidate the emsdk cache when needed
EM_KEY: 'v1'
jobs:
# The `build` job builds and tests all packages in the monorepo
build:
runs-on: ${{ matrix.config.os }}
timeout-minutes: 20
strategy:
matrix:
config:
- { plat: 'linux', os: 'ubuntu-20.04' }
# - { plat: 'mac', os: 'macos-10.15' }
# - { plat: 'win', os: 'windows-2019' }
steps:
# Force Unix-style line endings (otherwise Prettier checks will fail on Windows)
- name: Configure git to use Unix-style line endings
if: matrix.config.plat == 'win'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out repo
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
# The pnpm caching strategy in the following steps is based on:
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Configure pnpm
if: matrix.config.plat == 'win'
run: |
# Force pnpm to use bash shell for running scripts on Windows
pnpm config set script-shell bash
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Enable pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- name: Install dependencies
shell: bash
run: |
pnpm install
- name: Build and test
shell: bash
run: |
./scripts/ci-build
# The `test_c` job runs the C-level integration tests. This job runs in parallel with
# the other jobs (which cuts down on overall time to execute the workflow) because it
# only needs to build a subset of the packages in order to run the integration tests.
test_c:
runs-on: ${{ matrix.config.os }}
timeout-minutes: 20
strategy:
matrix:
config:
- { plat: 'linux', os: 'ubuntu-20.04' }
# - { plat: 'mac', os: 'macos-10.15' }
# - { plat: 'win', os: 'windows-2019' }
steps:
# Force Unix-style line endings (otherwise Prettier checks will fail on Windows)
- name: Configure git to use Unix-style line endings
if: matrix.config.plat == 'win'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out repo
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
# The pnpm caching strategy in the following steps is based on:
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Configure pnpm
if: matrix.config.plat == 'win'
run: |
# Force pnpm to use bash shell for running scripts on Windows
pnpm config set script-shell bash
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Enable pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- name: Install dependencies
shell: bash
run: |
pnpm install
- name: Run integration tests
shell: bash
run: |
./scripts/ci-run-c-int-tests
# The `test_js` job runs the JS-level integration tests. This job runs in parallel with
# the other jobs (which cuts down on overall time to execute the workflow) because it
# only needs to build a subset of the packages in order to run the integration tests.
test_js:
runs-on: ${{ matrix.config.os }}
timeout-minutes: 20
strategy:
matrix:
config:
- { plat: 'linux', os: 'ubuntu-20.04' }
# - { plat: 'mac', os: 'macos-10.15' }
# - { plat: 'win', os: 'windows-2019' }
steps:
# Force Unix-style line endings (otherwise Prettier checks will fail on Windows)
- name: Configure git to use Unix-style line endings
if: matrix.config.plat == 'win'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out repo
uses: actions/checkout@v3
- name: Enable Emscripten cache
uses: actions/cache@v3
with:
path: ${{env.EM_DIR}}
key: emsdk-app-${{env.EM_VERSION}}-${{env.EM_KEY}}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
# The pnpm caching strategy in the following steps is based on:
# https://github.com/pnpm/action-setup#use-cache-to-reduce-installation-time
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 8
- name: Configure pnpm
if: matrix.config.plat == 'win'
run: |
# Force pnpm to use bash shell for running scripts on Windows
pnpm config set script-shell bash
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Enable pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- name: Install dependencies
shell: bash
run: |
pnpm install
- name: Install Emscripten
shell: bash
run: |
./scripts/install-emsdk
- name: Run integration tests
shell: bash
run: |
./scripts/ci-run-js-int-tests