46
46
run : |
47
47
make test-rewatch-ci
48
48
49
- build-rewatch :
50
- strategy :
51
- fail-fast : false
52
- matrix :
53
- include :
54
- - os : macos-13 # x64
55
- rust-target : x86_64-apple-darwin
56
- node-target : darwin-x64
57
- - os : macos-14 # ARM
58
- rust-target : aarch64-apple-darwin
59
- node-target : darwin-arm64
60
- - os : ubuntu-24.04 # x64
61
- rust-target : x86_64-unknown-linux-musl
62
- node-target : linux-x64
63
- - os : ubuntu-24.04-arm # ARM
64
- rust-target : aarch64-unknown-linux-musl
65
- node-target : linux-arm64
66
- - os : windows-latest
67
- rust-target : x86_64-pc-windows-gnu
68
- node-target : win32-x64
69
-
70
- runs-on : ${{matrix.os}}
71
-
72
- env :
73
- RUST_BACKTRACE : " 1"
74
-
75
- steps :
76
- - name : Checkout
77
- uses : actions/checkout@v4
78
-
79
- - name : Use Node.js
80
- uses : actions/setup-node@v4
81
- with :
82
- node-version-file : .nvmrc
83
-
84
- - name : Restore build cache
85
- id : build-cache
86
- uses : actions/cache@v4
87
- with :
88
- path : rewatch/target
89
- key : rewatch-build-v2-${{ matrix.rust-target }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
90
-
91
- - name : Install musl gcc
92
- if : steps.build-cache.outputs.cache-hit != 'true' && runner.os == 'Linux'
93
- run : sudo apt-get install -y --no-install-recommends musl-tools
94
-
95
- - name : Install rust toolchain
96
- if : steps.build-cache.outputs.cache-hit != 'true'
97
- uses : dtolnay/rust-toolchain@master
98
- with :
99
- toolchain : stable
100
- targets : ${{ matrix.rust-target }}
101
-
102
- - name : Build rewatch
103
- if : steps.build-cache.outputs.cache-hit != 'true'
104
- run : |
105
- cargo build --manifest-path rewatch/Cargo.toml --target ${{ matrix.rust-target }} --release
106
-
107
- - name : Run rewatch unit tests
108
- if : steps.build-cache.outputs.cache-hit != 'true'
109
- run : |
110
- cargo test --manifest-path rewatch/Cargo.toml
111
-
112
- - name : Copy rewatch binary
113
- run : |
114
- cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch.exe
115
- shell : bash
116
-
117
- - name : " Upload artifact: rewatch binary"
118
- uses : actions/upload-artifact@v4
119
- with :
120
- name : rewatch-${{ matrix.node-target }}
121
- path : rewatch.exe
122
- if-no-files-found : error
123
-
124
49
build-compiler :
125
50
strategy :
126
51
fail-fast : false
@@ -131,33 +56,44 @@ jobs:
131
56
upload_binaries : true
132
57
upload_libs : true
133
58
node-target : linux-x64
59
+ rust-target : x86_64-unknown-linux-musl
134
60
- os : ubuntu-24.04-arm # ARM
135
61
ocaml_compiler : ocaml-variants.5.3.0+options,ocaml-option-static
136
62
upload_binaries : true
137
63
# Build the playground compiler and run the benchmarks on the fastest runner
138
64
build_playground : true
139
65
benchmarks : true
140
66
node-target : linux-arm64
67
+ rust-target : aarch64-unknown-linux-musl
141
68
- os : macos-13 # x64
142
69
ocaml_compiler : 5.3.0
143
70
upload_binaries : true
144
71
node-target : darwin-x64
72
+ rust-target : x86_64-apple-darwin
145
73
- os : macos-14 # ARM
146
74
ocaml_compiler : 5.3.0
147
75
upload_binaries : true
148
76
node-target : darwin-arm64
77
+ rust-target : aarch64-apple-darwin
149
78
- os : windows-latest
150
79
ocaml_compiler : 5.3.0
151
80
upload_binaries : true
152
81
node-target : win32-x64
82
+ rust-target : x86_64-pc-windows-gnu
153
83
154
84
# Verify that the compiler still builds with older OCaml versions
155
85
- os : ubuntu-24.04
156
86
ocaml_compiler : ocaml-variants.5.2.1+options,ocaml-option-static
87
+ node-target : linux-x64
88
+ rust-target : x86_64-unknown-linux-musl
157
89
- os : ubuntu-24.04
158
90
ocaml_compiler : ocaml-variants.5.0.0+options,ocaml-option-static
91
+ node-target : linux-x64
92
+ rust-target : x86_64-unknown-linux-musl
159
93
- os : ubuntu-24.04
160
94
ocaml_compiler : ocaml-variants.4.14.2+options,ocaml-option-static
95
+ node-target : linux-x64
96
+ rust-target : x86_64-unknown-linux-musl
161
97
162
98
runs-on : ${{matrix.os}}
163
99
@@ -166,6 +102,7 @@ jobs:
166
102
# we do track its version manually
167
103
OPAM_VERSION : 2.3.0
168
104
DUNE_PROFILE : release
105
+ RUST_BACKTRACE : " 1"
169
106
170
107
steps :
171
108
- name : " Windows: Set git config"
@@ -184,6 +121,9 @@ jobs:
184
121
cache : yarn
185
122
node-version-file : .nvmrc
186
123
124
+ - name : Install npm packages
125
+ run : yarn install
126
+
187
127
- name : Install dependencies (Linux)
188
128
if : runner.os == 'Linux'
189
129
@@ -192,6 +132,36 @@ jobs:
192
132
packages : bubblewrap darcs g++-multilib gcc-multilib mercurial musl-tools rsync
193
133
version : v3
194
134
135
+ - name : Restore rewatch build cache
136
+ id : rewatch-build-cache
137
+ uses : actions/cache@v4
138
+ with :
139
+ path : rewatch/target
140
+ key : rewatch-build-v2-${{ matrix.rust-target }}-${{ hashFiles('rewatch/src/**', 'rewatch/Cargo.lock') }}
141
+
142
+ - name : Install rust toolchain
143
+ if : steps.rewatch-build-cache.outputs.cache-hit != 'true'
144
+ uses : dtolnay/rust-toolchain@master
145
+ with :
146
+ toolchain : stable
147
+ targets : ${{ matrix.rust-target }}
148
+
149
+ - name : Build rewatch
150
+ if : steps.rewatch-build-cache.outputs.cache-hit != 'true'
151
+ run : |
152
+ cargo build --manifest-path rewatch/Cargo.toml --target ${{ matrix.rust-target }} --release
153
+
154
+ - name : Run rewatch unit tests
155
+ if : steps.rewatch-build-cache.outputs.cache-hit != 'true'
156
+ run : |
157
+ cargo test --manifest-path rewatch/Cargo.toml
158
+
159
+ - name : Copy rewatch binary
160
+ run : |
161
+ cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
162
+ ./scripts/copyExes.js --rewatch
163
+ shell : bash
164
+
195
165
# matrix.ocaml_compiler may contain commas
196
166
- name : Get OPAM cache key
197
167
shell : bash
@@ -336,9 +306,6 @@ jobs:
336
306
_build
337
307
key : ${{ steps.compiler-build-state-key.outputs.value }}
338
308
339
- - name : Install npm packages
340
- run : yarn install
341
-
342
309
- name : Copy compiler exes to platform bin dir
343
310
run : node scripts/copyExes.js --compiler
344
311
@@ -472,7 +439,6 @@ jobs:
472
439
473
440
pkg-pr-new :
474
441
needs :
475
- - build-rewatch
476
442
- build-compiler
477
443
runs-on : ubuntu-24.04-arm
478
444
steps :
@@ -488,7 +454,7 @@ jobs:
488
454
- name : Download artifacts
489
455
uses : actions/download-artifact@v4
490
456
with :
491
- pattern : " @(binaries-*|rewatch-*| lib-ocaml)"
457
+ pattern : " @(binaries-*|lib-ocaml)"
492
458
493
459
- name : Move artifacts into packages
494
460
run : .github/workflows/moveArtifacts.sh
@@ -554,7 +520,6 @@ jobs:
554
520
555
521
publish :
556
522
needs :
557
- - build-rewatch
558
523
- build-compiler
559
524
- installationTest
560
525
if : startsWith(github.ref, 'refs/tags/v')
@@ -573,7 +538,7 @@ jobs:
573
538
- name : Download artifacts
574
539
uses : actions/download-artifact@v4
575
540
with :
576
- pattern : " @(binaries-*|rewatch-*| lib-ocaml)"
541
+ pattern : " @(binaries-*|lib-ocaml)"
577
542
578
543
- name : Move artifacts into packages
579
544
run : .github/workflows/moveArtifacts.sh
0 commit comments