@@ -40,40 +40,47 @@ jobs:
40
40
include :
41
41
- os : ubuntu-latest
42
42
target : x86_64-unknown-linux-gnu
43
- use-cross : false
43
+ binary : x86-64
44
+ cargo-tool : cargo
44
45
run-integration-tests : true
45
46
- os : ubuntu-latest
46
47
target : x86_64-unknown-linux-musl
47
- use-cross : true
48
+ binary : x86-64
49
+ cargo-tool : cross
48
50
run-integration-tests : true
49
51
- os : ubuntu-latest
50
52
target : aarch64-unknown-linux-gnu
51
- use-cross : true
53
+ binary : aarch64
54
+ cargo-tool : cross
52
55
run-integration-tests : false # Cannot run aarch64 binaries on x86_64
53
56
- os : ubuntu-latest
54
57
target : aarch64-unknown-linux-musl
55
- use-cross : true
58
+ binary : aarch64
59
+ cargo-tool : cross
56
60
run-integration-tests : false # Cannot run aarch64 binaries on x86_64
57
61
# macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
58
62
- os : macos-13 # intel
59
63
target : x86_64-apple-darwin
60
- use-cross : false
64
+ binary : x86_64
65
+ cargo-tool : cargo
61
66
run-integration-tests : true
62
67
- os : macos-latest # aarch64
63
68
toolchain : stable
64
69
target : aarch64-apple-darwin
65
- use-cross : false
70
+ binary : arm64
71
+ cargo-tool : cargo
66
72
run-integration-tests : true
67
73
- os : windows-latest
68
74
target : x86_64-pc-windows-msvc
69
- use-cross : false
75
+ binary : x86-64
76
+ cargo-tool : cargo
70
77
run-integration-tests : true
71
78
steps :
72
79
- name : Checkout repository
73
80
uses : actions/checkout@v4
74
81
75
82
- name : Install musl-tools incl. musl-gcc
76
- uses : awalsh128/cache-apt-pkgs-action@v1
83
+ uses : awalsh128/cache-apt-pkgs-action@v1.4.3
77
84
with :
78
85
# musl-tools provide `musl-gcc` which is required for `ring` which is required for `rustls` et al.
79
86
packages : musl-tools
@@ -106,19 +113,36 @@ jobs:
106
113
key : v1-${{ matrix.target }}
107
114
108
115
- name : Install Gleam
109
- uses : clechasseur/rs-cargo@v2
116
+ uses : clechasseur/rs-cargo@v3
110
117
with :
111
118
command : install
112
- args : " --path compiler-cli --target ${{ matrix.target }} --debug --locked"
113
- use-cross : ${{ matrix.use-cross }}
119
+ args : " --path compiler-cli --target ${{ matrix.target }} --debug --locked --force"
120
+ tool : ${{ matrix.cargo-tool }}
121
+ if : ${{ matrix.run-integration-tests }}
122
+
123
+ - name : Verify binary architecture
124
+ shell : bash
125
+ run : |
126
+ BINARY_PATH="${CARGO_HOME}/bin/gleam"
127
+ if [[ "${{ matrix.target }}" == *"windows"* ]]; then
128
+ BINARY_PATH="${BINARY_PATH}.exe"
129
+ fi
130
+
131
+ if ! file -b "$BINARY_PATH" | grep -q "${{ matrix.binary }}"; then
132
+ echo "error: Architecture mismatch"
133
+ echo "Expected architecture: '${{ matrix.binary }}'"
134
+ echo "Found binary type: '$(file -b "$BINARY_PATH")'"
135
+ exit 1
136
+ fi
137
+ echo "ok: Architecture match"
114
138
if : ${{ matrix.run-integration-tests }}
115
139
116
140
- name : Run tests
117
- uses : clechasseur/rs-cargo@v2
141
+ uses : clechasseur/rs-cargo@v3
118
142
with :
119
143
command : test
120
144
args : " --workspace --target ${{ matrix.target }}"
121
- use-cross : ${{ matrix.use-cross }}
145
+ tool : ${{ matrix.cargo-tool }}
122
146
123
147
- name : test/project_erlang (non-windows)
124
148
run : |
@@ -152,12 +176,19 @@ jobs:
152
176
working-directory : ./test/project_erlang_windows
153
177
if : ${{ runner.os == 'Windows' && matrix.run-integration-tests }}
154
178
155
- - name : test/project_erlang export package-interface
179
+ - name : test/project_erlang export package-interface (non-windows)
156
180
run : |
157
181
gleam export package-interface --out="interface.json"
158
182
cat interface.json
159
183
working-directory : ./test/project_erlang
160
- if : ${{ matrix.run-integration-tests }}
184
+ if : ${{ runner.os != 'Windows' && matrix.run-integration-tests }}
185
+
186
+ - name : test/project_erlang export package-interface (windows)
187
+ run : |
188
+ gleam export package-interface --out="interface.json"
189
+ cat interface.json
190
+ working-directory : ./test/project_erlang_windows
191
+ if : ${{ runner.os == 'Windows' && matrix.run-integration-tests }}
161
192
162
193
- name : test/external_only_javascript
163
194
run : ./test.sh
@@ -173,6 +204,13 @@ jobs:
173
204
env :
174
205
GLEAM_COMMAND : gleam
175
206
207
+ - name : test/root_package_not_compiled_when_running_dep
208
+ run : ./test.sh
209
+ working-directory : ./test/root_package_not_compiled_when_running_dep
210
+ if : ${{ matrix.run-integration-tests }}
211
+ env :
212
+ GLEAM_COMMAND : gleam
213
+
176
214
- name : test/project_javascript
177
215
run : |
178
216
gleam run
@@ -248,7 +286,7 @@ jobs:
248
286
249
287
- uses : actions/setup-node@v4
250
288
with :
251
- node-version : " 18 "
289
+ node-version : " 20 "
252
290
253
291
- name : Install wasm-pack
254
292
run : |
@@ -282,7 +320,7 @@ jobs:
282
320
uses : actions/checkout@v4
283
321
284
322
- name : Ensure no merge commits
285
- uses : NexusPHP/no-merge-commits@v2.1.0
323
+ uses : NexusPHP/no-merge-commits@v2.2.1
286
324
if : github.event_name == 'pull_request'
287
325
with :
288
326
token : ${{ secrets.GITHUB_TOKEN }}
@@ -342,9 +380,9 @@ jobs:
342
380
uses : actions/checkout@v4
343
381
344
382
- name : Install Deno
345
- uses : denoland/setup-deno@v1
383
+ uses : denoland/setup-deno@v2
346
384
with :
347
- deno-version : v1 .x
385
+ deno-version : v2 .x
348
386
349
387
- name : Install Bun
350
388
uses : oven-sh/setup-bun@v2
@@ -405,3 +443,15 @@ jobs:
405
443
- name : Test running modules
406
444
run : make test
407
445
working-directory : ./test/running_modules
446
+
447
+ - name : test/multi_namespace
448
+ run : ./test.sh
449
+ working-directory : ./test/multi_namespace
450
+
451
+ - name : Test FFI in subdirectories
452
+ run : make
453
+ working-directory : ./test/subdir_ffi
454
+
455
+ - name : test/unicode_path
456
+ run : make
457
+ working-directory : ./test/unicode_path ⭐
0 commit comments