20
20
OCAMLRUNPARAM : b
21
21
22
22
jobs :
23
- build-rewatch :
24
- strategy :
25
- fail-fast : false
26
- matrix :
27
- include :
28
- - os : macos-13 # x64
29
- rust-target : x86_64-apple-darwin
30
- node-target : darwin-x64
31
- - os : macos-14 # ARM
32
- rust-target : aarch64-apple-darwin
33
- node-target : darwin-arm64
34
- - os : ubuntu-24.04 # x64
35
- rust-target : x86_64-unknown-linux-musl
36
- node-target : linux-x64
37
- - os : ubuntu-24.04-arm # ARM
38
- rust-target : aarch64-unknown-linux-musl
39
- node-target : linux-arm64
40
- - os : windows-latest
41
- rust-target : x86_64-pc-windows-gnu
42
- node-target : win32-x64
43
-
44
- runs-on : ${{matrix.os}}
45
-
46
- env :
47
- RUST_BACKTRACE : " 1"
48
-
49
- steps :
50
- - name : Checkout
51
- uses : actions/checkout@v4
52
-
53
- - name : Use Node.js
54
- uses : actions/setup-node@v4
55
- with :
56
- node-version-file : .nvmrc
57
-
58
- - name : Restore build cache
59
- id : build-cache
60
- uses : actions/cache@v4
61
- with :
62
- path : rewatch/target
63
- key : rewatch-build-v2-${{ matrix.rust-target }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
64
-
65
- - name : Install musl gcc
66
- if : steps.build-cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
67
- run : sudo apt-get install -y --no-install-recommends musl-tools
68
-
69
- - name : Install rust toolchain
70
- if : steps.build-cache.outputs.cache-hit != 'true'
71
- uses : dtolnay/rust-toolchain@master
72
- with :
73
- toolchain : stable
74
- targets : ${{ matrix.rust-target }}
75
-
76
- - name : Build rewatch
77
- if : steps.build-cache.outputs.cache-hit != 'true'
78
- run : |
79
- cargo build --manifest-path rewatch/Cargo.toml --target ${{ matrix.rust-target }} --release
80
-
81
- - name : Copy rewatch binary
82
- run : |
83
- cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch.exe
84
- shell : bash
85
-
86
- - name : " Upload artifact: rewatch binary"
87
- uses : actions/upload-artifact@v4
88
- with :
89
- name : rewatch-${{ matrix.node-target }}
90
- path : rewatch.exe
91
- if-no-files-found : error
92
-
93
23
build-compiler :
94
24
strategy :
95
25
fail-fast : false
@@ -100,33 +30,44 @@ jobs:
100
30
upload_binaries : true
101
31
upload_libs : true
102
32
node-target : linux-x64
33
+ rust-target : x86_64-unknown-linux-musl
103
34
- os : ubuntu-24.04-arm # ARM
104
35
ocaml_compiler : ocaml-variants.5.3.0+options,ocaml-option-static
105
36
upload_binaries : true
106
37
# Build the playground compiler and run the benchmarks on the fastest runner
107
38
build_playground : true
108
39
benchmarks : true
109
40
node-target : linux-arm64
41
+ rust-target : aarch64-unknown-linux-musl
110
42
- os : macos-13 # x64
111
43
ocaml_compiler : 5.3.0
112
44
upload_binaries : true
113
45
node-target : darwin-x64
46
+ rust-target : x86_64-apple-darwin
114
47
- os : macos-14 # ARM
115
48
ocaml_compiler : 5.3.0
116
49
upload_binaries : true
117
50
node-target : darwin-arm64
51
+ rust-target : aarch64-apple-darwin
118
52
- os : windows-latest
119
53
ocaml_compiler : 5.3.0
120
54
upload_binaries : true
121
55
node-target : win32-x64
56
+ rust-target : x86_64-pc-windows-gnu
122
57
123
58
# Verify that the compiler still builds with older OCaml versions
124
59
- os : ubuntu-24.04
125
60
ocaml_compiler : ocaml-variants.5.2.1+options,ocaml-option-static
61
+ node-target : linux-x64
62
+ rust-target : x86_64-unknown-linux-musl
126
63
- os : ubuntu-24.04
127
64
ocaml_compiler : ocaml-variants.5.0.0+options,ocaml-option-static
65
+ node-target : linux-x64
66
+ rust-target : x86_64-unknown-linux-musl
128
67
- os : ubuntu-24.04
129
68
ocaml_compiler : ocaml-variants.4.14.2+options,ocaml-option-static
69
+ node-target : linux-x64
70
+ rust-target : x86_64-unknown-linux-musl
130
71
131
72
runs-on : ${{matrix.os}}
132
73
135
76
# we do track its version manually
136
77
OPAM_VERSION : 2.3.0
137
78
DUNE_PROFILE : release
79
+ RUST_BACKTRACE : " 1"
138
80
139
81
steps :
140
82
- name : " Windows: Set git config"
153
95
cache : yarn
154
96
node-version-file : .nvmrc
155
97
98
+ - name : Install npm packages
99
+ run : yarn install
100
+
156
101
- name : Install dependencies (Linux)
157
102
if : runner.os == 'Linux'
158
103
@@ -161,6 +106,36 @@ jobs:
161
106
packages : bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync
162
107
version : v3
163
108
109
+ - name : Restore rewatch build cache
110
+ id : rewatch-build-cache
111
+ uses : actions/cache@v4
112
+ with :
113
+ path : rewatch/target
114
+ key : rewatch-build-v2-${{ matrix.rust-target }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
115
+
116
+ - name : Install rust toolchain
117
+ if : steps.rewatch-build-cache.outputs.cache-hit != 'true'
118
+ uses : dtolnay/rust-toolchain@master
119
+ with :
120
+ toolchain : stable
121
+ targets : ${{ matrix.rust-target }}
122
+
123
+ - name : Build rewatch
124
+ if : steps.rewatch-build-cache.outputs.cache-hit != 'true'
125
+ run : |
126
+ cargo build --manifest-path rewatch/Cargo.toml --target ${{ matrix.rust-target }} --release
127
+
128
+ - name : Run rewatch unit tests
129
+ if : steps.rewatch-build-cache.outputs.cache-hit != 'true'
130
+ run : |
131
+ cargo test --manifest-path rewatch/Cargo.toml
132
+
133
+ - name : Copy rewatch binary
134
+ run : |
135
+ cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
136
+ ./scripts/copyExes.js --rewatch
137
+ shell : bash
138
+
164
139
# matrix.ocaml_compiler may contain commas
165
140
- name : Get OPAM cache key
166
141
shell : bash
@@ -305,9 +280,6 @@ jobs:
305
280
_build
306
281
key : ${{ steps.compiler-build-state-key.outputs.value }}
307
282
308
- - name : Install npm packages
309
- run : yarn install
310
-
311
283
- name : Copy compiler exes to platform bin dir
312
284
run : node scripts/copyExes.js --compiler
313
285
@@ -352,7 +324,13 @@ jobs:
352
324
if : ${{ runner.os == 'Windows' }}
353
325
run : opam exec -- make test-syntax
354
326
355
- - name : Build runtime/stdlib
327
+ - name : Build runtime/stdlib with rewatch
328
+ if : ${{ runner.os != 'Windows' }}
329
+ run : ./scripts/buildRuntimeRewatch.sh
330
+ shell : bash
331
+
332
+ - name : Build runtime/stdlib with bsb (Windows)
333
+ if : ${{ runner.os == 'Windows' }}
356
334
run : ./scripts/buildRuntime.sh
357
335
shell : bash
358
336
@@ -440,8 +418,7 @@ jobs:
440
418
path : lib/ocaml
441
419
442
420
pkg-pr-new :
443
- needs :
444
- - build-rewatch
421
+ needs :
445
422
- build-compiler
446
423
runs-on : ubuntu-24.04-arm
447
424
steps :
@@ -457,7 +434,7 @@ jobs:
457
434
- name : Download artifacts
458
435
uses : actions/download-artifact@v4
459
436
with :
460
- pattern : " @(binaries-*|rewatch-*| lib-ocaml)"
437
+ pattern : " @(binaries-*|lib-ocaml)"
461
438
462
439
- name : Move artifacts into packages
463
440
run : .github/workflows/moveArtifacts.sh
@@ -467,27 +444,23 @@ jobs:
467
444
run : |
468
445
yarn dlx pkg-pr-new publish "." "./packages/@rescript/*"
469
446
470
- installationTest :
447
+ test-integration :
471
448
needs :
472
449
- pkg-pr-new
473
450
strategy :
474
451
fail-fast : false
475
452
matrix :
476
453
include :
477
454
- os : macos-13
478
- node-target : darwin-x64
479
455
- os : macos-14
480
- node-target : darwin-arm64
481
456
- os : ubuntu-24.04
482
- node-target : linux-x64
483
457
- os : ubuntu-24.04-arm
484
- node-target : linux-arm64
485
458
- os : windows-latest
486
- node-target : win32-x64
487
459
runs-on : ${{ matrix.os }}
460
+ env :
461
+ RUST_BACKTRACE : " 1"
488
462
steps :
489
463
- name : Checkout
490
- id : checkout
491
464
uses : actions/checkout@v4
492
465
493
466
- name : Use Node.js
@@ -521,11 +494,22 @@ jobs:
521
494
shell : bash
522
495
working-directory : ${{ steps.tmp-dir.outputs.path }}
523
496
497
+ - name : Install ReScript package in rewatch/testrepo
498
+ if : runner.os == 'Linux'
499
+ run : |
500
+ COMMIT_SHA="${{ github.event.pull_request.head.sha || github.sha }}"
501
+ yarn add "rescript@https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA::7}"
502
+ shell : bash
503
+ working-directory : rewatch/testrepo
504
+
505
+ - name : Run rewatch integration tests
506
+ # Currently failing on Windows and intermittently on macOS
507
+ if : runner.os == 'Linux'
508
+ run : make test-rewatch-ci
509
+
524
510
publish :
525
511
needs :
526
- - build-rewatch
527
- - build-compiler
528
- - installationTest
512
+ - test-integration
529
513
if : startsWith(github.ref, 'refs/tags/v')
530
514
runs-on : ubuntu-24.04-arm
531
515
steps :
@@ -542,7 +526,7 @@ jobs:
542
526
- name : Download artifacts
543
527
uses : actions/download-artifact@v4
544
528
with :
545
- pattern : " @(binaries-*|rewatch-*| lib-ocaml)"
529
+ pattern : " @(binaries-*|lib-ocaml)"
546
530
547
531
- name : Move artifacts into packages
548
532
run : .github/workflows/moveArtifacts.sh
0 commit comments