-
Notifications
You must be signed in to change notification settings - Fork 21
/
config.yml
684 lines (657 loc) · 26.3 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
version: 2.1
orbs:
build-tools: circleci/build-tools@2.9.0
win: circleci/windows@2.2.0
commands:
checkout-and-merge-to-main:
steps:
- checkout
- run:
name: Configure git user
command: |
# required by merge-with-parent (for some unknown reason)
git config user.email "circleci@example.com"
git config user.name "CircleCI"
- build-tools/merge-with-parent:
parent: main
install-java-11:
description: install openjdk-11
steps:
- run:
name: Install java 11
command: |
wget https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.8_10.tar.gz -O /tmp/openjdk-11.tar.gz
sudo mkdir -p /usr/lib/jvm
sudo tar xfvz /tmp/openjdk-11.tar.gz --directory /usr/lib/jvm
rm -f /tmp/openjdk-11.tar.gz
sudo sh -c 'for bin in /usr/lib/jvm/jdk-11.0.8+10/bin/*; do update-alternatives --install /usr/bin/$(basename $bin) $(basename $bin) $bin 100; done'
sudo sh -c 'for bin in /usr/lib/jvm/jdk-11.0.8+10/bin/*; do update-alternatives --set $(basename $bin) $bin; done'
install-java-11-macos:
description: install openjdk-11
steps:
- run:
name: Install java 11
command: |
brew update
brew install openjdk@11
# brew-installed sbt uses openjdk for default java home
ln -sfn /usr/local/opt/openjdk@11 /usr/local/opt/openjdk
install-java-11-win:
description: install openjdk-11
steps:
- run:
name: Install java 11
command: |
choco upgrade -y --ignore-package-exit-codes --ignore-detected-reboot visualstudio2019-workload-vctools openjdk11
setup_sbt:
description: "Set up sbt"
parameters:
version:
type: string
default: "1.4.9"
steps:
- install-java-11
- run:
name: Install sbt
command: |
curl -L -o sbt-<< parameters.version >>.deb https://repo.scala-sbt.org/scalasbt/debian/sbt-<< parameters.version >>.deb
sudo dpkg -i sbt-<< parameters.version >>.deb
rm sbt-<< parameters.version >>.deb
setup_sbt_macos:
description: "Set up sbt"
steps:
- install-java-11-macos
- run:
name: Install sbt
environment:
HOMEBREW_NO_AUTO_UPDATE: 1
command: |
# Call brew update explicitly until Circle CI update their images,
# see https://github.com/Homebrew/brew/issues/11123
brew update
# don't install openjdk dependency (currently @16)
brew install sbt --ignore-dependencies
setup_sbt_win:
description: "Set up sbt"
parameters:
version:
type: string
default: "1.4.9"
steps:
- install-java-11-win
- run:
name: Install sbt
command: |
choco install sbt --version=<< parameters.version >>
save_deps_cache:
description: "Save dependency cache"
steps:
- save_cache:
key: deps-cache-01
paths:
- "~/.ivy2/cache"
- "~/.sbt"
- "~/.cache/coursier"
restore_deps_cache:
description: "Restore dependency cache"
steps:
- restore_cache:
key: deps-cache-01
publish_to_cloudsmith:
parameters:
filePath:
type: string
fileName:
type: string
version:
type: string
steps:
- run: |
id=$(curl \
--upload-file <<parameters.filePath>> \
-u "${CLOUDSMITH_API_USERNAME}:${CLOUDSMITH_API_PASSWORD}" \
https://upload.cloudsmith.io/lightbend/kalix/<<parameters.fileName>> | jq -r '.identifier')
curl -X POST -H "Content-Type: application/json" \
-u "${CLOUDSMITH_API_USERNAME}:${CLOUDSMITH_API_PASSWORD}" \
-d "{\"package_file\": \"$id\", \"version\": \"<<parameters.version>>\"}" \
https://api-prd.cloudsmith.io/v1/packages/lightbend/kalix/upload/raw/
publish_to_cloudsmith_win:
parameters:
filePath:
type: string
fileName:
type: string
version:
type: string
steps:
- run:
shell: bash.exe
command: |
choco upgrade -y --ignore-package-exit-codes --ignore-detected-reboot curl jq
id=$(curl \
--upload-file "<<parameters.filePath>>" \
-u "${CLOUDSMITH_API_USERNAME}:${CLOUDSMITH_API_PASSWORD}" \
https://upload.cloudsmith.io/lightbend/kalix/<<parameters.fileName>> | jq -r '.identifier')
curl -X POST -H "Content-Type: application/json" \
-u "${CLOUDSMITH_API_USERNAME}:${CLOUDSMITH_API_PASSWORD}" \
-d "{\"package_file\": \"$id\", \"version\": \"<<parameters.version>>\"}" \
https://api-prd.cloudsmith.io/v1/packages/lightbend/kalix/upload/raw/
jobs:
test-codegen:
docker:
- image: cimg/openjdk:11.0
description: "Test the codegen"
steps:
- checkout-and-merge-to-main
- setup_sbt
- restore_deps_cache
- run:
name: Run scalafmt checks
working_directory: "~/project/codegen"
command: |
sbt scalafmtCheckAll scalafmtSbtCheck || \
{ echo "[error] Code not formatted prior to commit. Run 'sbt scalafmtAll scalafmtSbt' then commit the reformatted code."; false; }
- run:
name: Run header checks
working_directory: "~/project/codegen"
command: |
sbt headerCheckAll || \
{ echo "[error] Code missing headers prior to commit. Run 'sbt headerCreateAll' then commit the updated code."; false; }
- run:
name: Run the tests
working_directory: "~/project/codegen"
command: sbt test
- save_deps_cache
tests:
machine:
image: ubuntu-2004:202104-01
description: "tests"
steps:
- checkout-and-merge-to-main
- run:
name: "run checks"
command: |
npm ci && npm run license-check && npm run prettier-check
- run:
name: "check vulnerabilities in transitive dependencies"
command: |
pushd sdk && npm audit --production && popd
# build/run these sample tests with local version of kalix-scripts
- setup_sbt
- restore_deps_cache
- run:
name: "compile codegen binary"
working_directory: "~/project/codegen"
command: sbt kalix-codegen-js-cli/nativeImage
- run:
name: "install kalix-scripts"
working_directory: "~/project/npm-js/kalix-scripts"
command: |
source /opt/circleci/.nvm/nvm.sh
nvm install
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm ci && npm pack
- run:
name: "build sdk"
command: |
pushd sdk && npm ci && npm test && npm pack && popd
- run:
name: "Test JS Value Entity Counter sample"
command: |
cd samples/js/valueentity-counter
# don't download, used the one we built
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz
npm install
npm run build
npm test
- run:
name: "Test JS Value Entity Shopping Cart sample"
command: |
cd samples/js/js-valueentity-shopping-cart
# don't download, used the one we built
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz
npm install
npm run build
npm test
- run:
name: "Test JS Event Sourced Entity Shopping Cart sample"
command: |
cd samples/js/js-eventsourced-shopping-cart
# don't download, used the one we built
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz
npm install
npm run build
npm test
- run:
name: "Test TS Value Entity Counter sample"
command: |
cd samples/ts/ts-valueentity-counter
# don't download, used the one we built
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz
npm install
npm run build
npm test
- run:
name: "Test TS Value Entity Shopping Cart sample"
command: |
cd samples/ts/ts-valueentity-shopping-cart
# don't download, used the one we built
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz
npm install
npm run build
npm test
- run:
name: "Test TS Event Sourced Entity Shopping Cart sample"
command: |
cd samples/ts/ts-eventsourced-shopping-cart
# don't download, used the one we built
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz
npm install
npm run build
npm test
integration-tests:
machine:
image: ubuntu-2004:202104-01
description: "integration tests"
steps:
- checkout-and-merge-to-main
# build/run these sample tests with local version of kalix-scripts
- setup_sbt
- restore_deps_cache
- run:
name: "compile codegen binary"
working_directory: "~/project/codegen"
command: sbt kalix-codegen-js-cli/nativeImage
- run:
name: "install kalix-scripts"
working_directory: "~/project/npm-js/kalix-scripts"
command: |
source /opt/circleci/.nvm/nvm.sh
nvm install
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm ci && npm pack
- run:
name: "run integration tests"
command: |
export VERSION_CHECK_ON_STARTUP=false
source /opt/circleci/.nvm/nvm.sh
pushd sdk && nvm install && npm ci && DEBUG='testcontainers*' npm run integration-test && npm pack && popd
# don't download, used the one we built
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
pushd samples/js/js-customer-registry && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm ci && npm run integration-test && popd
pushd samples/js/valueentity-counter && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
pushd samples/js/js-valueentity-shopping-cart && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
pushd samples/js/js-eventsourced-shopping-cart && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
pushd samples/js/js-replicated-entity-shopping-cart && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
pushd samples/ts/ts-customer-registry && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm ci && npm run integration-test && popd
pushd samples/ts/ts-valueentity-counter && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
pushd samples/ts/ts-valueentity-shopping-cart && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
pushd samples/ts/ts-eventsourced-shopping-cart && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
pushd samples/ts/ts-replicated-entity-shopping-cart && npm install --save ../../../sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz ../../../npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz && npm install && npm run build && npm run integration-test && popd
tck-tests:
machine:
image: ubuntu-2004:202104-01
description: "TCK tests"
steps:
- checkout-and-merge-to-main
- run:
name: "run TCK tests"
command: |
source /opt/circleci/.nvm/nvm.sh
pushd sdk && nvm install && npm ci && npm pack && popd
pushd tck && npm install && npm run tck && popd
validate-docs:
machine:
image: ubuntu-2004:202104-01
description: "validate docs"
steps:
- checkout-and-merge-to-main
- run:
name: "validate docs"
command: |
source /opt/circleci/.nvm/nvm.sh
pushd sdk && nvm install && popd
make -C docs
# temporarily disabled
# make -C docs validate-links
publish:
docker:
- image: cimg/node:14.16.1
steps:
- checkout
- run:
name: "publish to npm"
command: |
echo "//registry.npmjs.org/:_authToken=$KALIX_IO_NPM_TOKEN" > ~/.npmrc
pushd sdk && npm ci && npm publish --access public && popd
git reset --hard HEAD
pushd npm-js/create-kalix-entity && npm publish --access public && popd
git reset --hard HEAD
pushd npm-js/kalix-scripts && npm publish --access public && popd
publish-tck:
machine:
image: ubuntu-2004:202104-01
description: "publish TCK"
steps:
- checkout
- run: bin/docker-login-public-gcr.sh
- run:
name: "publish TCK docker image"
command: |
source /opt/circleci/.nvm/nvm.sh
pushd tck && nvm install && npm run docker-build && npm run docker-push && popd
publish-docs:
machine:
image: ubuntu-2004:202104-01
description: "publish docs"
steps:
- checkout
# deploy key for pushing docs to branch
- add_ssh_keys:
fingerprints:
- "d1:35:c0:f1:89:8c:45:06:6f:f9:7e:a3:b5:57:18:87"
- run:
name: "publish docs"
command: |
source /opt/circleci/.nvm/nvm.sh
pushd sdk && nvm install && popd
make -C docs deploy
npm-js-tests:
docker:
- image: cimg/node:14.16.1
description: "npm-js-tests"
steps:
- checkout-and-merge-to-main
- setup_sbt
- restore_deps_cache
- run:
name: "compile codegen binary"
working_directory: "~/project/codegen"
command: sbt kalix-codegen-js-cli/nativeImage
- run:
name: "install codegen"
command: |
cd npm-js/create-kalix-entity
npm ci && npm pack
- run:
name: "install kalix-scripts"
command: |
cd npm-js/kalix-scripts
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm ci && npm pack
- run:
name: "install sdk"
command: |
cd sdk
npm ci && npm pack
- run:
name: "test everything"
working_directory: "~/tmp"
command: |
export KALIX_NPMJS_SCRIPTS_VERSION="file:${HOME}/project/npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz"
export KALIX_NPMJS_SDK_VERSION="file:${HOME}/project/sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz"
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
node "${HOME}/project/npm-js/create-kalix-entity/create-kalix-entity.js" generated-project
cd generated-project
npm install && \
npm run build && \
npm run test
e2e-tests:
machine:
image: ubuntu-2004:202104-01
description: "e2e-tests"
steps:
- checkout-and-merge-to-main
- setup_sbt
- restore_deps_cache
- run:
name: "compile codegen binary"
working_directory: "~/project/codegen"
command: sbt kalix-codegen-js-cli/nativeImage
- run:
name: "install codegen"
working_directory: "~/project/npm-js/create-kalix-entity"
command: |
source /opt/circleci/.nvm/nvm.sh
nvm install
npm ci && npm pack
- run:
name: "install kalix-scripts"
working_directory: "~/project/npm-js/kalix-scripts"
command: |
source /opt/circleci/.nvm/nvm.sh
nvm install
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
npm ci && npm pack
- run:
name: "install sdk"
working_directory: "~/project/sdk"
command: |
source /opt/circleci/.nvm/nvm.sh
nvm install
npm ci && npm pack
- run:
name: "generate project"
working_directory: "~/tmp"
command: |
source /opt/circleci/.nvm/nvm.sh
nvm install v14
export KALIX_NPMJS_SCRIPTS_VERSION="file:${HOME}/project/npm-js/kalix-scripts/kalix-io-kalix-scripts-1.0.0.tgz"
export KALIX_NPMJS_SDK_VERSION="file:${HOME}/project/sdk/kalix-io-kalix-javascript-sdk-0.0.0.tgz"
node "${HOME}/project/npm-js/create-kalix-entity/create-kalix-entity.js" generated-project --template event-sourced-entity
- run:
name: "test up to unit tests"
working_directory: "~/tmp/generated-project"
command: |
source /opt/circleci/.nvm/nvm.sh
export KALIX_NPMJS_CODEGEN_BINARY="${HOME}/project/codegen/js-gen-cli/target/native-image/kalix-codegen-js"
nvm install v14
npm install && \
npm run build && \
npm run test
- run:
name: "test the full local dev env"
working_directory: "~/tmp/generated-project"
environment:
HOST: "0.0.0.0"
USER_FUNCTION_HOST: "172.17.0.1"
shell: /bin/bash
command: |
source /opt/circleci/.nvm/nvm.sh
nvm install v14
# Run proxy in background
sed -i docker-compose.yml -e "s/environment:/environment:\n VERSION_CHECK_ON_STARTUP: \"false\"/"
docker-compose up -d
# Run the service in background
npm run start &
# Test the event-sourced-entity
until curl -XPOST localhost:9000/com.example.MyServiceEntity/GetValue -H "Content-Type:application/json" -d '{"entityId":"test"}' -o response.txt; do sleep 5; done
echo "Validating expected error message"
test "$(cat response.txt)" = 'The command handler for `GetValue` is not implemented, yet'
publish_native_linux:
machine:
image: ubuntu-2004:202104-01
description: "Build Native image on Linux"
steps:
- checkout
- setup_sbt
- restore_deps_cache
- run:
name: Build Native Image
working_directory: "~/project/codegen"
command: |
./set-version.sh
sbt test kalix-codegen-js-cli/nativeImage
mv "js-gen-cli/target/native-image/kalix-codegen-js" "kalix-codegen-js-x86_64-unknown-linux-gnu"
- publish_to_cloudsmith:
filePath: "~/project/codegen/kalix-codegen-js-x86_64-unknown-linux-gnu"
fileName: "kalix-codegen-js-x86_64-unknown-linux-gnu"
version: $(sdk/bin/version.sh)
- save_deps_cache
publish_native_macos:
macos:
xcode: 12.5.0
description: "Build Native image on macOS"
steps:
- checkout
- setup_sbt_macos
- run:
name: Build Native Image
working_directory: "~/project/codegen"
command: |
./set-version.sh
sbt test kalix-codegen-js-cli/nativeImage
mv "js-gen-cli/target/native-image/kalix-codegen-js" "kalix-codegen-js-x86_64-apple-darwin"
- publish_to_cloudsmith:
filePath: "~/project/codegen/kalix-codegen-js-x86_64-apple-darwin"
fileName: "kalix-codegen-js-x86_64-apple-darwin"
version: $(sdk/bin/version.sh)
publish_native_win:
executor:
name: win/default
description: "Build Native image on Windows"
steps:
- checkout
- setup_sbt_win
- run:
name: Build Native Image
working_directory: "~/project/codegen"
command: |
# here be dragons: https://help.appveyor.com/discussions/questions/18777-how-to-use-vcvars64bat-from-powershell
cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\vc\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}
bash set-version.sh
sbt test kalix-codegen-js-cli/nativeImage
mv.exe "js-gen-cli\target\native-image\kalix-codegen-js.exe" "kalix-codegen-js-x86_64-pc-windows-gnu.exe"
- publish_to_cloudsmith_win:
filePath: 'C:\\Users\\circleci\\project\\codegen\\kalix-codegen-js-x86_64-pc-windows-gnu.exe'
fileName: "kalix-codegen-js-x86_64-pc-windows-gnu.exe"
version: $(sdk/bin/version.sh)
workflows:
CI:
jobs:
- tests:
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
- integration-tests:
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
- tck-tests:
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
- validate-docs:
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
- npm-js-tests:
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
- e2e-tests:
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
- test-codegen:
filters: # required since publish jobs have tag filters and dependencies
tags:
only: /.*/
- publish:
filters: # version tags only
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- tests
- integration-tests
- tck-tests
- validate-docs
- npm-js-tests
- e2e-tests
- test-codegen
- publish-tck:
filters: # version tags only
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- tests
- integration-tests
- tck-tests
- validate-docs
- npm-js-tests
- e2e-tests
- test-codegen
- publish-docs:
filters: # version tags only
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- tests
- integration-tests
- tck-tests
- validate-docs
- npm-js-tests
- e2e-tests
- test-codegen
- publish_native_linux:
context:
- cloudsmith
filters: # version tags only
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- tests
- integration-tests
- tck-tests
- validate-docs
- npm-js-tests
- e2e-tests
- publish_native_macos:
context:
- cloudsmith
filters: # version tags only
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- tests
- integration-tests
- tck-tests
- validate-docs
- npm-js-tests
- e2e-tests
- publish_native_win:
context:
- cloudsmith
filters: # version tags only
tags:
only: /^v.*/
branches:
ignore: /.*/
requires:
- tests
- integration-tests
- tck-tests
- validate-docs
- npm-js-tests
- e2e-tests