@@ -1,6 +1,6 @@
3−# Trigger the workflow on push or pull request, but only for the main branch
3+# Trigger the workflow on push or pull request, but only for the master branch
5 pull_request:
5 pull_request:
@@ -21,15 +21,6 @@ jobs:
23 - "8.10.2"
23 - "8.10.2"
29− # - os: windows-latest
31− # - os: windows-latest
35 - uses: actions/checkout@v2
26 - uses: actions/checkout@v2
@@ -124,39 +115,38 @@ jobs:
124 stack test --system-ghc
115 stack test --system-ghc
127− name: stack / ghcjs 8.4
118+ name: cabal / ghcjs 8.4
128 runs-on: "ubuntu-18.04"
119 runs-on: "ubuntu-18.04"
131 - uses: actions/checkout@v2
122 - uses: actions/checkout@v2
123+ - name: "Setup PATH"
125+ echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV
133− - name: Install ghcjs and tools
127+ - name: Install tools
135 sudo add-apt-repository ppa:hvr/ghcjs
129 sudo add-apt-repository ppa:hvr/ghcjs
136 sudo apt-get update -y
130 sudo apt-get update -y
137 sudo apt-get install ghcjs-8.4
131 sudo apt-get install ghcjs-8.4
138 sudo apt-get install cabal-install
132 sudo apt-get install cabal-install
140 # Override cabal.project with the lightweight GHCJS one
134 # Override cabal.project with the lightweight GHCJS one
141 cp cabal.ghcjs.project cabal.project
135 cp cabal.ghcjs.project cabal.project
142 cat cabal.project
136 cat cabal.project
144− export PATH=/opt/ghcjs/8.4.4/bin:$PATH
145− export PATH="$HOME/.cabal/bin:$PATH"
146 cabal v2-update
138 cabal v2-update
148− ls /opt/ghcjs/8.4/bin
149− # cabal v2-install --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --ignore-project hspec-discover
150 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project cabal-plan --constraint='cabal-plan ^>=0.6.0.0' --constraint='cabal-plan +exe'
139 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project cabal-plan --constraint='cabal-plan ^>=0.6.0.0' --constraint='cabal-plan +exe'
151 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
140 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
153 - name: Build
142 - name: Build
155− export PATH=/opt/ghcjs/8.4.4/bin:$PATH
156− export PATH="$HOME/.cabal/bin:$PATH"
157 cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all
144 cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all
159 - name: Run tests
146 - name: Run tests
161− export PATH="$HOME/.cabal/bin:$PATH"
148+ # cabal v2-test does not work with GHCJS
149+ # See: https://github.com/haskell/cabal/issues/6175
151+ # This invokes cabal-plan to figure out test binaries, and invokes them with node.
162 cabal-plan list-bins '*:test:*' | while read -r line; do testpkg=$(echo "$line" | perl -pe 's/:.*//'); testexe=$(echo "$line" | awk '{ print $2 }'); echo "testing $textexe in package $textpkg"; (cd "$(pkgdir $testpkg)" && nodejs "$testexe".jsexe/all.js); done
152 cabal-plan list-bins '*:test:*' | while read -r line; do testpkg=$(echo "$line" | perl -pe 's/:.*//'); testexe=$(echo "$line" | awk '{ print $2 }'); echo "testing $textexe in package $textpkg"; (cd "$(pkgdir $testpkg)" && nodejs "$testexe".jsexe/all.js); done