diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fd04799f..dff7f4513 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,16 +22,18 @@ jobs: build: eval $(opam env) && cd analysis && make test artifact-folder: linux - os: windows-latest - build: | - cd analysis - # git checkout converted these to windows newline. Convert back to unix newline here - dos2unix test.sh tests/src/*.res tests/src/*.resi - & $env:CYGWIN_ROOT\\bin\\ocaml-env exec -- make + build: "cd analysis && & $env:CYGWIN_ROOT\\bin\\ocaml-env exec -- make test" artifact-folder: win32 runs-on: ${{matrix.os}} steps: + # needed for Windows testing + - name: Set git to use LF + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - uses: actions/checkout@v2.3.4 - name: Cache OCaml's opam diff --git a/analysis/test.sh b/analysis/test.sh index 6ba881f21..9585a319d 100755 --- a/analysis/test.sh +++ b/analysis/test.sh @@ -1,9 +1,10 @@ -function exp { - echo "$(dirname $1)/expected/$(basename $1).txt" -} - for file in tests/src/*.{res,resi}; do - ./rescript-editor-analysis.exe test $file &> $(exp $file) + output="$(dirname $file)/expected/$(basename $file).txt" + ./rescript-editor-analysis.exe test $file &> $output + # CI. We use LF, and the CI OCaml fork prints CRLF. Convert. + if [ "$RUNNER_OS" == "Windows" ]; then + perl -pi -e 's/\r\n/\n/g' -- $output + fi done warningYellow='\033[0;33m'