Skip to content

Commit e81e1ff

Browse files
authored
Fix Windows CI (#7550)
* Unset CLICOLOR_FORCE for rewatch tests * Do not invoke "bash" without specifying its full path * Fix * Fix
1 parent 34ebfe0 commit e81e1ff

File tree

5 files changed

+24
-31
lines changed

5 files changed

+24
-31
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
run: |
138138
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch
139139
mkdir -p rewatch/target/release
140-
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release
140+
cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release
141141
./scripts/copyExes.js --rewatch
142142
shell: bash
143143

@@ -321,13 +321,11 @@ jobs:
321321
if: steps.ninja-build-cache.outputs.cache-hit != 'true'
322322
run: node scripts/copyExes.js --ninja
323323

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
324+
- name: "Syntax: Run tests"
325+
env:
326+
ROUNDTRIP_TEST: ${{ runner.os == 'Windows' && '0' || '1' }}
327+
run: ./scripts/test_syntax.sh
328+
shell: bash
331329

332330
- name: Build runtime/stdlib with rewatch
333331
if: ${{ runner.os != 'Windows' }}
@@ -360,7 +358,8 @@ jobs:
360358
run: make -C tests/gentype_tests/typescript-react-example clean test
361359

362360
- name: Run rewatch tests
363-
run: make test-rewatch
361+
run: ./rewatch/tests/suite-ci.sh
362+
shell: bash
364363

365364
- name: Run syntax benchmarks
366365
if: matrix.benchmarks
@@ -524,8 +523,8 @@ jobs:
524523
working-directory: rewatch/testrepo
525524

526525
- name: Run rewatch integration tests
527-
# Currently failing on Windows and intermittently on macOS
528-
run: make test-rewatch-integration
526+
run: ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch
527+
shell: bash
529528

530529
publish:
531530
needs:

Makefile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,21 @@ test: build lib
3131

3232
test-analysis:
3333
make -C tests/analysis_tests clean test
34-
34+
3535
test-tools:
3636
make -C tests/tools_tests clean test
3737

3838
test-syntax:
39-
bash ./scripts/test_syntax.sh
40-
bash ./scripts/testok.sh
39+
./scripts/test_syntax.sh
4140

4241
test-syntax-roundtrip:
43-
ROUNDTRIP_TEST=1 bash ./scripts/test_syntax.sh
44-
bash ./scripts/testok.sh
42+
ROUNDTRIP_TEST=1 ./scripts/test_syntax.sh
4543

4644
test-gentype:
4745
make -C tests/gentype_tests/typescript-react-example clean test
4846

4947
test-rewatch:
50-
bash ./rewatch/tests/suite-ci.sh
51-
52-
test-rewatch-integration:
53-
bash ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch
48+
./rewatch/tests/suite-ci.sh
5449

5550
test-all: test test-gentype test-analysis test-tools test-rewatch
5651

@@ -82,10 +77,10 @@ playground-release: playground playground-cmijs
8277
yarn workspace playground upload-bundle
8378

8479
format:
85-
bash scripts/format.sh
80+
./scripts/format.sh
8681

8782
checkformat:
88-
bash scripts/format_check.sh
83+
./scripts/format_check.sh
8984

9085
clean-gentype:
9186
make -C tests/gentype_tests/typescript-react-example clean
@@ -97,7 +92,7 @@ clean:
9792
(cd runtime && ../cli/rescript.js clean)
9893
dune clean
9994

100-
clean-all: clean clean-gentype clean-rewatch
95+
clean-all: clean clean-gentype clean-rewatch
10196

10297
dev-container:
10398
docker build -t rescript-dev-container docker

rewatch/tests/suite-ci.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash
2+
3+
unset CLICOLOR_FORCE
4+
25
# Make sure we are in the right directory
36
cd $(dirname $0)
47

@@ -23,11 +26,11 @@ git checkout ../testrepo/package.json &> /dev/null
2326
success "Reset package.json and yarn.lock"
2427

2528
bold "Make sure the testrepo is clean"
26-
if git diff --exit-code ../testrepo &> diff.txt;
29+
if git diff --exit-code ../testrepo &> diff.txt;
2730
then
2831
rm diff.txt
2932
success "Testrepo has no changes"
30-
else
33+
else
3134
error "Testrepo is not clean to start with"
3235
cat diff.txt
3336
rm diff.txt

scripts/test_syntax.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,5 @@ fi
117117

118118
rm -r temp/
119119
popd
120+
121+
printf "${successGreen}✅ All syntax tests passed.${reset}\n"

scripts/testok.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)