21
21
22
22
jobs :
23
23
build-compiler :
24
+ outputs :
25
+ api-docs-artifact-id : ${{ steps.upload-api-docs.outputs.artifact-id }}
24
26
strategy :
25
27
fail-fast : false
26
28
matrix :
36
38
upload_binaries : true
37
39
# Build the playground compiler and run the benchmarks on the fastest runner
38
40
build_playground : true
41
+ generate_api_docs : true
39
42
benchmarks : true
40
43
node-target : linux-arm64
41
44
rust-target : aarch64-unknown-linux-musl
@@ -137,7 +140,7 @@ jobs:
137
140
run : |
138
141
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
139
142
mkdir -p rewatch/target/release
140
- cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release
143
+ cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release
141
144
./scripts/copyExes.js --rewatch
142
145
shell : bash
143
146
@@ -321,13 +324,11 @@ jobs:
321
324
if : steps.ninja-build-cache.outputs.cache-hit != 'true'
322
325
run : node scripts/copyExes.js --ninja
323
326
324
- - name : " Syntax: Run roundtrip tests"
325
- if : ${{ runner.os != 'Windows' }}
326
- run : opam exec -- make test-syntax-roundtrip
327
-
328
- - name : " Syntax: Run tests (Windows)"
329
- if : ${{ runner.os == 'Windows' }}
330
- run : opam exec -- make test-syntax
327
+ - name : " Syntax: Run tests"
328
+ env :
329
+ ROUNDTRIP_TEST : ${{ runner.os == 'Windows' && '0' || '1' }}
330
+ run : ./scripts/test_syntax.sh
331
+ shell : bash
331
332
332
333
- name : Build runtime/stdlib with rewatch
333
334
if : ${{ runner.os != 'Windows' }}
@@ -360,7 +361,8 @@ jobs:
360
361
run : make -C tests/gentype_tests/typescript-react-example clean test
361
362
362
363
- name : Run rewatch tests
363
- run : make test-rewatch
364
+ run : ./rewatch/tests/suite-ci.sh
365
+ shell : bash
364
366
365
367
- name : Run syntax benchmarks
366
368
if : matrix.benchmarks
@@ -439,6 +441,18 @@ jobs:
439
441
name : lib-ocaml
440
442
path : lib/ocaml
441
443
444
+ - name : Generate API Docs
445
+ if : ${{ matrix.generate_api_docs }}
446
+ run : yarn apidocs:generate
447
+
448
+ - name : " Upload artifacts: scripts/res/apiDocs"
449
+ id : upload-api-docs
450
+ if : ${{ matrix.generate_api_docs }}
451
+ uses : actions/upload-artifact@v4
452
+ with :
453
+ name : api
454
+ path : scripts/res/apiDocs/
455
+
442
456
pkg-pr-new :
443
457
needs :
444
458
- build-compiler
@@ -466,6 +480,49 @@ jobs:
466
480
run : |
467
481
yarn dlx pkg-pr-new publish "." "./packages/@rescript/*"
468
482
483
+ api-docs :
484
+ needs :
485
+ - build-compiler
486
+ runs-on : ubuntu-24.04-arm
487
+ steps :
488
+ - name : Checkout rescript-lang.org
489
+ uses : actions/checkout@v4
490
+ with :
491
+ repository : rescript-lang/rescript-lang.org
492
+ ssh-key : ${{ secrets.RESCRIPT_LANG_ORG_DEPLOY_KEY }}
493
+
494
+ - name : Download artifacts
495
+ uses : actions/download-artifact@v4
496
+ with :
497
+ artifact-ids : ${{ needs.build-compiler.outputs.api-docs-artifact-id }}
498
+ path : data
499
+
500
+ - name : Check if repo is clean
501
+ id : diffcheck
502
+ run : |
503
+ git status
504
+ if [ -z "$(git status --porcelain)" ]; then
505
+ echo "clean=true" >> $GITHUB_OUTPUT
506
+ else
507
+ echo "clean=false" >> $GITHUB_OUTPUT
508
+ fi
509
+
510
+ - name : Build website
511
+ if : steps.diffcheck.outputs.clean == 'false'
512
+ run : |
513
+ npm ci
514
+ npx rescript
515
+ npm run build
516
+
517
+ - name : Commit and push
518
+ if : ${{ startsWith(github.ref, 'refs/tags/v') }}
519
+ run : |
520
+ git config --global user.name "github-actions[bot]"
521
+ git config --global user.email "github-actions@rescript-lang.org"
522
+ git add data/api
523
+ git commit -m "Update API docs for ${{ github.ref_name }}"
524
+ git push
525
+
469
526
test-integration :
470
527
needs :
471
528
- pkg-pr-new
@@ -488,7 +545,8 @@ jobs:
488
545
- name : Use Node.js
489
546
uses : actions/setup-node@v4
490
547
with :
491
- node-version-file : .nvmrc
548
+ # Run integration tests with the oldest supported node version.
549
+ node-version : 20
492
550
493
551
- name : Make test directory
494
552
id : tmp-dir
@@ -524,8 +582,8 @@ jobs:
524
582
working-directory : rewatch/testrepo
525
583
526
584
- name : Run rewatch integration tests
527
- # Currently failing on Windows and intermittently on macOS
528
- run : make test-rewatch-integration
585
+ run : ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch
586
+ shell : bash
529
587
530
588
publish :
531
589
needs :
0 commit comments