diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ff7e1d89..58cd030dc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: run: | cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch mkdir -p rewatch/target/release - cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release + cp rewatch/target/${{ matrix.rust-target }}/release/rewatch${{ runner.os == 'Windows' && '.exe' || '' }} rewatch/target/release ./scripts/copyExes.js --rewatch shell: bash @@ -321,13 +321,11 @@ jobs: if: steps.ninja-build-cache.outputs.cache-hit != 'true' run: node scripts/copyExes.js --ninja - - name: "Syntax: Run roundtrip tests" - if: ${{ runner.os != 'Windows' }} - run: opam exec -- make test-syntax-roundtrip - - - name: "Syntax: Run tests (Windows)" - if: ${{ runner.os == 'Windows' }} - run: opam exec -- make test-syntax + - name: "Syntax: Run tests" + env: + ROUNDTRIP_TEST: ${{ runner.os == 'Windows' && '0' || '1' }} + run: ./scripts/test_syntax.sh + shell: bash - name: Build runtime/stdlib with rewatch if: ${{ runner.os != 'Windows' }} @@ -360,7 +358,8 @@ jobs: run: make -C tests/gentype_tests/typescript-react-example clean test - name: Run rewatch tests - run: make test-rewatch + run: ./rewatch/tests/suite-ci.sh + shell: bash - name: Run syntax benchmarks if: matrix.benchmarks @@ -524,8 +523,8 @@ jobs: working-directory: rewatch/testrepo - name: Run rewatch integration tests - # Currently failing on Windows and intermittently on macOS - run: make test-rewatch-integration + run: ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch + shell: bash publish: needs: diff --git a/Makefile b/Makefile index dcc4fc7550..032b80f314 100644 --- a/Makefile +++ b/Makefile @@ -31,26 +31,21 @@ test: build lib test-analysis: make -C tests/analysis_tests clean test - + test-tools: make -C tests/tools_tests clean test test-syntax: - bash ./scripts/test_syntax.sh - bash ./scripts/testok.sh + ./scripts/test_syntax.sh test-syntax-roundtrip: - ROUNDTRIP_TEST=1 bash ./scripts/test_syntax.sh - bash ./scripts/testok.sh + ROUNDTRIP_TEST=1 ./scripts/test_syntax.sh test-gentype: make -C tests/gentype_tests/typescript-react-example clean test test-rewatch: - bash ./rewatch/tests/suite-ci.sh - -test-rewatch-integration: - bash ./rewatch/tests/suite-ci.sh node_modules/.bin/rewatch + ./rewatch/tests/suite-ci.sh test-all: test test-gentype test-analysis test-tools test-rewatch @@ -82,10 +77,10 @@ playground-release: playground playground-cmijs yarn workspace playground upload-bundle format: - bash scripts/format.sh + ./scripts/format.sh checkformat: - bash scripts/format_check.sh + ./scripts/format_check.sh clean-gentype: make -C tests/gentype_tests/typescript-react-example clean @@ -97,7 +92,7 @@ clean: (cd runtime && ../cli/rescript.js clean) dune clean -clean-all: clean clean-gentype clean-rewatch +clean-all: clean clean-gentype clean-rewatch dev-container: docker build -t rescript-dev-container docker diff --git a/rewatch/tests/suite-ci.sh b/rewatch/tests/suite-ci.sh index 87fd645cb5..d36319b988 100755 --- a/rewatch/tests/suite-ci.sh +++ b/rewatch/tests/suite-ci.sh @@ -1,4 +1,7 @@ #!/bin/bash + +unset CLICOLOR_FORCE + # Make sure we are in the right directory cd $(dirname $0) @@ -23,11 +26,11 @@ git checkout ../testrepo/package.json &> /dev/null success "Reset package.json and yarn.lock" bold "Make sure the testrepo is clean" -if git diff --exit-code ../testrepo &> diff.txt; +if git diff --exit-code ../testrepo &> diff.txt; then rm diff.txt success "Testrepo has no changes" -else +else error "Testrepo is not clean to start with" cat diff.txt rm diff.txt diff --git a/scripts/test_syntax.sh b/scripts/test_syntax.sh index d3d735825e..85f09f7d57 100755 --- a/scripts/test_syntax.sh +++ b/scripts/test_syntax.sh @@ -117,3 +117,5 @@ fi rm -r temp/ popd + +printf "${successGreen}✅ All syntax tests passed.${reset}\n" diff --git a/scripts/testok.sh b/scripts/testok.sh deleted file mode 100755 index c65295f062..0000000000 --- a/scripts/testok.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -successGreen='\033[0;32m' -reset='\033[0m' - -printf "${successGreen}✅ All Tests Passed${reset}\n"