Skip to content

Remove custom setup to enable cross-compilation #122

Remove custom setup to enable cross-compilation

Remove custom setup to enable cross-compilation #122

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:
cabal:
name: cabal / ghc-${{ matrix.ghc }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
# ubuntu-22.04 (currently ubuntu-latest) appears to not be able to
# install ghc-8.2.2 with ghcup. Possibly because of
# https://github.com/haskell/actions/issues/133.
# TODO: Need to look into what is going on here, and try upgrading
# back to ubuntu-latest at some point.
# - ubuntu-latest
- ubuntu-20.04
# OSX builds were flakey at some point in the past, so we disabled
# them. pretty-simple doesn't have any interesting system-level
# dependencies, so it is probably okay we aren't testing on OSX.
# - macOS-latest
cabal:
- "latest"
ghc:
- "8.0.2"
- "8.2.2"
- "8.4.4"
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.4"
steps:
- uses: actions/checkout@v2
#if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v1
name: Cache cabal-store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
- name: Build
run: |
cabal update
# TODO: We have a problem where cabal is not able to come up with a
# build plan on GHC-9.2 because the ./cabal.project file defines both
# pretty-simple, and ./web as packages. ./web uses a version of jsaddle
# that doesn't seem to work yet on GHC-9.2. It doesn't seem possible
# to tell cabal to just ignore the web package, and only run the solver
# for pretty-simple.
#
# This hacky workaround just deletes the cabal.project file, so that
# cabal doesn't realize there is another package in ./web.
#
# This workaround can likely be removed when we move to a more recent
# version of jsaddle.
rm ./cabal.project
cabal build package:pretty-simple --enable-tests --enable-benchmarks --write-ghc-environment-files=always --flags="buildexample"
- name: Test
run: |
cabal test package:pretty-simple --enable-tests
stack:
name: stack / ubuntu-latest
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["latest"]
steps:
- uses: actions/checkout@v2
#if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: haskell/actions/setup@v2
name: Setup Haskell Stack
with:
stack-version: ${{ matrix.stack }}
enable-stack: true
- uses: actions/cache@v1
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack
- name: Build
run: |
stack build --test --bench --no-run-tests --no-run-benchmarks --flag pretty-simple:buildexample
- name: Test
run: |
stack test
nix-build-web:
name: Nix build GHCJS web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v16
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8=
substituters = https://cache.nixos.org/ https://miso-haskell.cachix.org
- name: Build web
run: nix-build ./web