This commit is contained in:
Gaël Deest 2021-03-17 21:32:04 +01:00
parent 95d4f5030f
commit 6452942a69

View file

@ -1,6 +1,6 @@
name: CI name: CI
# Trigger the workflow on push or pull request, but only for the main branch # Trigger the workflow on push or pull request, but only for the master branch
on: on:
pull_request: pull_request:
push: push:
@ -21,15 +21,6 @@ jobs:
- "8.6.5" - "8.6.5"
- "8.8.4" - "8.8.4"
- "8.10.2" - "8.10.2"
# exclude:
# - os: macOS-latest
# ghc: 8.8.4
# - os: macOS-latest
# ghc: 8.6.5
# - os: windows-latest
# ghc: 8.10.2
# - os: windows-latest
# ghc: 8.6.5
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -124,39 +115,38 @@ jobs:
stack test --system-ghc stack test --system-ghc
ghcjs: ghcjs:
name: stack / ghcjs 8.4 name: cabal / ghcjs 8.4
runs-on: "ubuntu-18.04" runs-on: "ubuntu-18.04"
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: "Setup PATH"
run: |
echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV
- name: Install ghcjs and tools - name: Install tools
run: | run: |
sudo add-apt-repository ppa:hvr/ghcjs sudo add-apt-repository ppa:hvr/ghcjs
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install ghcjs-8.4 sudo apt-get install ghcjs-8.4
sudo apt-get install cabal-install sudo apt-get install cabal-install
cabal --version
# Override cabal.project with the lightweight GHCJS one # Override cabal.project with the lightweight GHCJS one
cp cabal.ghcjs.project cabal.project cp cabal.ghcjs.project cabal.project
cat cabal.project cat cabal.project
export PATH=/opt/ghcjs/8.4.4/bin:$PATH
export PATH="$HOME/.cabal/bin:$PATH"
cabal v2-update cabal v2-update
ls /opt
ls /opt/ghcjs/8.4/bin
# cabal v2-install --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --ignore-project hspec-discover
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' 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'
cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
- name: Build - name: Build
run: | run: |
export PATH=/opt/ghcjs/8.4.4/bin:$PATH
export PATH="$HOME/.cabal/bin:$PATH"
cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all
- name: Run tests - name: Run tests
run: | run: |
export PATH="$HOME/.cabal/bin:$PATH" # cabal v2-test does not work with GHCJS
# See: https://github.com/haskell/cabal/issues/6175
#
# This invokes cabal-plan to figure out test binaries, and invokes them with node.
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-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