-
Notifications
You must be signed in to change notification settings - Fork 10
/
config.yml
231 lines (202 loc) · 4.84 KB
/
config.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
224
225
226
227
228
229
230
231
version: 2.1
orbs:
win: circleci/windows@2.4.0
aliases:
- &macos-env
macos:
xcode: 14.3.1
resource_class: macos.m1.medium.gen1
- &windows-env
executor:
name: win/default
shell: bash.exe
- &node-env
docker:
- image: cimg/node:lts
- &only_on_tag
filters:
branches:
ignore: /.*/
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
- ¬_on_tag
filters:
tags:
ignore: /^v.*/
commands:
restore_npm_cache:
description: Restore NPM cache
steps:
- restore_cache:
keys:
- npm-cache-v4-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
- npm-cache-v4-{{ arch }}-{{ .Branch }}
- npm-cache-v4-{{ arch }}
save_npm_cache:
description: Save NPM cache
steps:
- save_cache:
key: npm-cache-v4-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
- node_modules
npm_install:
description: Install NPM dependencies
steps:
- restore_npm_cache
- run: npm install
- save_npm_cache
install_npm_token:
steps:
- run:
name: Write NPM Token to ~/.npmrc
command: echo "//registry.npmjs.org/:_authToken=$NPM_ACCESS_TOKEN" >> ~/.npmrc
install_cmake_macos:
steps:
- run:
name: Install CMake
command: |
curl -o cmake.tar.gz -sL https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0-macos-universal.tar.gz
tar xf cmake.tar.gz --strip-components=1
rm cmake.tar.gz
chmod -R a+rwx "$PWD/CMake.app"
export PATH="$PATH:$PWD/CMake.app/Contents/bin"
sudo "$PWD/CMake.app/Contents/bin/cmake-gui" --install
install_cmake_windows:
steps:
- run:
name: Install CMake
command: |
choco install cmake -y --version=3.27.9 --installargs '"ADD_CMAKE_TO_PATH=User"'
PATH_TO_CMAKE='/c/Program Files/CMake/bin'
echo "export PATH='$PATH_TO_CMAKE:$PATH'" >> $BASH_ENV
build_library:
description: Build end-to-end testing library
steps:
- run:
name: Create end-to-end testing library
command: |
npm run generate
npm run build-cpp
persist:
steps:
- persist_to_workspace:
root: .
paths:
- cmake-build/*
- dist/*
test_example_app:
steps:
- run:
name: Test Example Application
command: npm run test-example
test_typescript_library:
steps:
- run:
name: Test TypeScript library
command: npm test
test_cpp_library:
steps:
- run:
name: Test C++ library
command: npm run test-cpp
jobs:
macos_build:
<<: *macos-env
steps:
- checkout
- npm_install
- install_cmake_macos
- build_library
- persist
windows_build:
<<: *windows-env
steps:
- checkout
- npm_install
- install_cmake_windows
- build_library
- persist
typescript_build:
<<: *node-env
steps:
- checkout
- npm_install
- run:
name: Lint
command: npm run lint
- run:
name: Compile TypeScript
command: npx tsc
- persist
macos_test:
<<: *macos-env
steps:
- checkout
- attach_workspace:
at: .
- npm_install
- install_cmake_macos
- test_example_app
- test_cpp_library
windows_test:
<<: *windows-env
steps:
- checkout
- attach_workspace:
at: .
- npm_install
- install_cmake_windows
- test_example_app
- test_cpp_library
typescript_test:
<<: *node-env
steps:
- checkout
- npm_install
- test_typescript_library
typescript_release:
<<: *node-env
steps:
- checkout
- install_npm_token
- npm_install
- attach_workspace:
at: .
- run:
name: Publish NPM package
command: npm publish --access=public
workflows:
build_and_test:
jobs:
- macos_build:
<<: *not_on_tag
- windows_build:
<<: *not_on_tag
- macos_test:
<<: *not_on_tag
requires:
- macos_build
- windows_test:
<<: *not_on_tag
requires:
- windows_build
- typescript_build:
<<: *not_on_tag
- typescript_test:
<<: *not_on_tag
requires:
- typescript_build
release:
jobs:
- typescript_build:
<<: *only_on_tag
- typescript_test:
<<: *only_on_tag
requires:
- typescript_build
- typescript_release:
<<: *only_on_tag
context:
- NPM-CONFIG
requires:
- typescript_test