2021-11-10 11:05:11 -05:00

106 lines
3.3 KiB
YAML

name: CI
on:
push:
branches:
- master
paths-ignore:
- 'demo/**'
- 'docker/**'
- 'Dockerfile'
- '.dockerignore'
- '.ghci'
- '.gitignore'
- 'images/**'
- 'notebooks/**'
- 'README.md'
- 'hie.yaml'
- '*.nix'
pull_request:
paths-ignore:
- 'demo/**'
- 'docker/**'
- 'Dockerfile'
- '.dockerignore'
- '.ghci'
- '.gitignore'
- 'images/**'
- 'notebooks/**'
- 'README.md'
- 'hie.yaml'
- '*.nix'
jobs:
linux:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
versions:
- stack-yaml: 'stack-8.0.yaml'
- stack-yaml: 'stack-8.2.yaml'
- stack-yaml: 'stack-8.4.yaml'
- stack-yaml: 'stack-8.6.yaml'
- stack-yaml: 'stack-8.8.yaml'
- stack-yaml: 'stack.yaml'
steps:
- uses: actions/checkout@v2
- name: Cache .stack
uses: actions/cache@v2.1.6
with:
path: ~/.stack/snapshots
key: ${{ runner.os }}-${{ matrix.versions.stack-yaml }}-${{ hashFiles(format('./{0}', matrix.versions.stack-yaml)) }}
restore-keys: |
${{ runner.os }}-${{ matrix.versions.stack-yaml }}
- name: Update system dependencies
run: |
sudo apt update
- name: Install system dependencies
run: |
sudo apt install libmagic-dev libgmp-dev libblas-dev liblapack-dev libcairo2-dev libpango1.0-dev libzmq3-dev jq
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Install Stack
run: |
export PATH=$HOME/.local/bin:$PATH
mkdir -p ~/.local/bin
curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
- name: Build dependencies
run: |
# Used to avoid 'source and destination file are the same' error
mv ${{ matrix.versions.stack-yaml }} intermediate-stack.yaml
mv intermediate-stack.yaml stack.yaml
echo "apply-ghc-options: everything" >> stack.yaml
stack setup
stack install gtk2hs-buildtools
stack build hmatrix
stack build --dependencies-only
- name: Run Haskell tests
run: |
set -e
stack build ipython-kernel --flag ipython-kernel:examples
stack test ihaskell --no-terminal
- name: Run integration test
# The test is flaky on GHC 8.0 so we don't run it. As long as the tests
# above pass, it's unlikely that we'll introduce a bug that we will
# only catch through the integration test on this version and not other
# versions.
if: ${{ matrix.versions.stack-yaml != 'stack-8.0.yaml' }}
run: |
set -e
stack build --no-terminal
# Ensure that IHaskell notebook remains unchanged.
# Run the notebook to regenerate the outputs, then compare the new notebook to the old one.
stack install
stack exec -- ihaskell install --stack
test/acceptance.nbconvert.sh stack exec -- jupyter nbconvert