diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87fdb132..2b6b19ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: 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 + 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: diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 425fb705..437a1d94 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -35,7 +35,7 @@ jobs: matrix: versions: - compiler: 'ghc884' - - compiler: 'ghc8102' + - compiler: 'ghc8104' steps: - uses: actions/checkout@v2 - uses: cachix/install-nix-action@v12 @@ -48,5 +48,8 @@ jobs: -I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-20.09 \ release.nix \ --argstr compiler ${{ matrix.versions.compiler }} - test/acceptance.nbconvert.sh result/bin/ihaskell-nbconvert + nix-shell \ + -I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-20.09 \ + -p jq --run \ + 'test/acceptance.nbconvert.sh result/bin/ihaskell-nbconvert' diff --git a/test/acceptance.nbconvert.sh b/test/acceptance.nbconvert.sh index 4f0cc39e..c12d3ec3 100755 --- a/test/acceptance.nbconvert.sh +++ b/test/acceptance.nbconvert.sh @@ -3,7 +3,8 @@ # Run nbconvert acceptance tests # ------------------------------ # -# This script must be called from the root directory of IHaskell. +# This script must be called from the root directory of IHaskell. It requires +# `jq` to be available in the $PATH. # # Positional arguments to this script are the invocation for `nbconvert`. # For example: @@ -27,7 +28,11 @@ set -euo pipefail -$* --to=notebook --execute --allow-errors --stdout test/acceptance.nbconvert.in.ipynb > test/acceptance.nbconvert.out.ipynb +$* --to=notebook --execute --allow-errors --stdout --nbformat=4 test/acceptance.nbconvert.in.ipynb > test/acceptance.nbconvert.out.ipynb -diff <(grep -v -e 'version' -e 'Line ' -e 'Integral' test/acceptance.nbconvert.in.ipynb) <(grep -v -e 'version' -e 'Line ' -e 'Integral' test/acceptance.nbconvert.out.ipynb) +diff \ + <(grep -v -e 'version' -e 'Line ' -e 'Integral' -e 'Num' \ + <(cat test/acceptance.nbconvert.in.ipynb | jq '{"cells": .cells | map(del(.metadata.execution)), "metadata": .metadata}')) \ + <(grep -v -e 'version' -e 'Line ' -e 'Integral' -e 'Num' \ + <(cat test/acceptance.nbconvert.out.ipynb | jq '{"cells": .cells | map(del(.metadata.execution)), "metadata": .metadata}'))