name: Stack on: push: paths-ignore: - 'demo/**' - 'docker/**' - 'Dockerfile' - '.dockerignore' - '.ghci' - '.gitignore' - 'images/**' - 'nix/**' - 'notebooks/**' - 'flake.nix' - 'flake.lock' - 'README.md' - 'hie.yaml' pull_request: paths-ignore: - 'demo/**' - 'docker/**' - 'Dockerfile' - '.dockerignore' - '.ghci' - '.gitignore' - 'images/**' - 'nix/**' - 'notebooks/**' - 'flake.nix' - 'flake.lock' - 'README.md' - 'hie.yaml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: linux: if: (github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork) || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: stack-yaml: - 'stack/stack-8.4.yaml' - 'stack/stack-8.6.yaml' - 'stack/stack-8.8.yaml' - 'stack/stack-8.10.yaml' - 'stack/stack-9.0.yaml' - 'stack/stack-9.2.yaml' - 'stack/stack-9.4.yaml' - 'stack/stack-9.6.yaml' - 'stack.yaml' steps: - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v22 with: install_url: https://releases.nixos.org/nix/nix-2.13.3/install - uses: haskell-actions/setup@v2 name: Setup Haskell Stack with: enable-stack: true stack-version: "latest" - uses: actions/cache@v3 name: Cache Haskell dependencies with: path: | ~/.stack/stack.sqlite3 ~/.stack/snapshots key: ${{ matrix.stack-yaml }}-${{ hashFiles(format('./{0}', matrix.stack-yaml)) }} restore-keys: | ${{ matrix.stack-yaml }}-${{ hashFiles(format('./{0}', matrix.stack-yaml)) }} ${{ matrix.stack-yaml }}- - name: Install system dependencies run: | sudo apt update sudo apt install libmagic-dev libgmp-dev libblas-dev liblapack-dev libcairo2-dev libpango1.0-dev libzmq3-dev jq - name: Test ipython-kernel run: | stack build ipython-kernel --flag ipython-kernel:examples --stack-yaml ${{matrix.stack-yaml}} - name: Build run: | export "NIX_PATH=nixpkgs=$(nix run .#print-nixpkgs-master)" stack build ihaskell --stack-yaml ${{matrix.stack-yaml}} - name: Test run: | stack test --stack-yaml ${{matrix.stack-yaml}} - name: Run integration test run: | nix build .#jupyterlab export PATH="$(pwd)/result/bin:$(pwd)/.local/bin:$PATH" stack install --stack-yaml ${{matrix.stack-yaml}} ihaskell install --stack --stack-flag="--stack-yaml=$(realpath ${{matrix.stack-yaml}})" # Ensure that IHaskell notebook remains unchanged. # Run the notebook to regenerate the outputs, then compare the new notebook to the old one. test/acceptance.nbconvert.sh jupyter nbconvert