@@ -1,6 +1,6 @@
11name: CI
22
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
44on:
55 pull_request:
66 push:
@@ -21,15 +21,6 @@ jobs:
2121 - "8.6.5"
2222 - "8.8.4"
2323 - "8.10.2"
24− # exclude:
25− # - os: macOS-latest
26− # ghc: 8.8.4
27− # - os: macOS-latest
28− # ghc: 8.6.5
29− # - os: windows-latest
30− # ghc: 8.10.2
31− # - os: windows-latest
32− # ghc: 8.6.5
3324
3425 steps:
3526 - uses: actions/checkout@v2
@@ -124,39 +115,38 @@ jobs:
124115 stack test --system-ghc
125116
126117 ghcjs:
127− name: stack / ghcjs 8.4
118+ name: cabal / ghcjs 8.4
128119 runs-on: "ubuntu-18.04"
129120
130121 steps:
131122 - uses: actions/checkout@v2
123+ - name: "Setup PATH"
124+ run: |
125+ echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV
132126
133− - name: Install ghcjs and tools
127+ - name: Install tools
134128 run: |
135129 sudo add-apt-repository ppa:hvr/ghcjs
136130 sudo apt-get update -y
137131 sudo apt-get install ghcjs-8.4
138132 sudo apt-get install cabal-install
139− cabal --version
133+
140134 # Override cabal.project with the lightweight GHCJS one
141135 cp cabal.ghcjs.project cabal.project
142136 cat cabal.project
143137
144− export PATH=/opt/ghcjs/8.4.4/bin:$PATH
145− export PATH="$HOME/.cabal/bin:$PATH"
146138 cabal v2-update
147− ls /opt
148− ls /opt/ghcjs/8.4/bin
149− # cabal v2-install --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --ignore-project hspec-discover
150139 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'
151140 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
152141
153142 - name: Build
154143 run: |
155− export PATH=/opt/ghcjs/8.4.4/bin:$PATH
156− export PATH="$HOME/.cabal/bin:$PATH"
157144 cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all
158145
159146 - name: Run tests
160147 run: |
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
150+ #
151+ # This invokes cabal-plan to figure out test binaries, and invokes them with node.
162152 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