Skip to content

Fix Windows CI #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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' }}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 7 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions rewatch/tests/suite-ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/bash

unset CLICOLOR_FORCE

# Make sure we are in the right directory
cd $(dirname $0)

Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions scripts/test_syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,5 @@ fi

rm -r temp/
popd

printf "${successGreen}✅ All syntax tests passed.${reset}\n"
6 changes: 0 additions & 6 deletions scripts/testok.sh

This file was deleted.

Loading