on master help sign in
Build / tests with GHCJS
commit95d4f5030f1cc1b078d26843b789ca3c13f2c8a4 authorGaël Deest <gael.deest@tweag.io> dateWed 17 Mar 2021, 12:11 (6 years ago) parent579a372
2 files changed+26−2
.github/workflows/main.yml+26−1 cabal.ghcjs.project−1
.github/workflows/main.yml+26−1
@@ -130,8 +130,33 @@ jobs:
130130 steps:
131131 - uses: actions/checkout@v2
132132
133− - name: Install ghcjs
133+ - name: Install ghcjs and tools
134134 run: |
135135 sudo add-apt-repository ppa:hvr/ghcjs
136136 sudo apt-get update -y
137137 sudo apt-get install ghcjs-8.4
138+ sudo apt-get install cabal-install
139+ cabal --version
140+ # Override cabal.project with the lightweight GHCJS one
141+ cp cabal.ghcjs.project cabal.project
142+ cat cabal.project
143+
144+ export PATH=/opt/ghcjs/8.4.4/bin:$PATH
145+ export PATH="$HOME/.cabal/bin:$PATH"
146+ 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
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'
151+ cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
152+
153+ - name: Build
154+ run: |
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
158+
159+ - name: Run tests
160+ run: |
161+ export PATH="$HOME/.cabal/bin:$PATH"
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
cabal.ghcjs.project−1
@@ -3,7 +3,6 @@
33packages:
44 servant/
55 servant-client-core/
6− servant-jsaddle/
76
87-- we need to tell cabal we are using GHCJS
98compiler: ghcjs