Skip to content

Source type ascription #37

Source type ascription

Source type ascription #37

Workflow file for this run

name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
jobs:
ghcjs:
name: ubuntu-20.04 / ghcjs 8.4
runs-on: "ubuntu-20.04"
steps:
- uses: actions/checkout@v2
- name: "Setup PATH"
run: |
echo "PATH=$HOME/.cabal/bin:/opt/ghcjs/8.4/bin:$PATH" >> $GITHUB_ENV
- name: Install ghcjs and cabal
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends software-properties-common
# Needed to get nodejs and npm
sudo add-apt-repository -y universe
# Default GitHub image dropped ppa:hvr/ghc, so we add it ourselves
sudo add-apt-repository ppa:hvr/ghc
sudo add-apt-repository ppa:hvr/ghcjs
sudo apt-get update -y
sudo apt-get install ghcjs-8.4
sudo apt-get install cabal-install
# Override cabal.project with the lightweight GHCJS one
cp cabal.ghcjs.project cabal.project
cat cabal.project
- name: Cabal update and freeze
run: |
cabal v2-update
cabal v2-freeze --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs
- uses: actions/[email protected]
name: Cache ~/.cabal/store and dist-newstyle
with:
path: |
~/.cabal/store
dist-newstyle
key: ubuntu-18.04-ghcjs8.4-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
ubuntu-18.04-ghcjs8.4-
- name: Install cabal-plan
run: |
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'
- name: Build
run: |
cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all
- name: Run tests
run: |
# 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