mirror of
https://github.com/IHaskell/IHaskell.git
synced 2025-04-16 03:16:20 +00:00
Merge pull request #1429 from codedownio/stack-nix-ci
CI: add stack --nix workflow
This commit is contained in:
commit
9160fe75ce
93
.github/workflows/stack-nix.yml
vendored
Normal file
93
.github/workflows/stack-nix.yml
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
name: Stack (--nix)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- 'demo/**'
|
||||
- 'docker/**'
|
||||
- 'Dockerfile'
|
||||
- '.dockerignore'
|
||||
- '.ghci'
|
||||
- '.gitignore'
|
||||
- 'images/**'
|
||||
- 'notebooks/**'
|
||||
- 'README.md'
|
||||
- 'hie.yaml'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- 'demo/**'
|
||||
- 'docker/**'
|
||||
- 'Dockerfile'
|
||||
- '.dockerignore'
|
||||
- '.ghci'
|
||||
- '.gitignore'
|
||||
- 'images/**'
|
||||
- 'notebooks/**'
|
||||
- 'README.md'
|
||||
- 'hie.yaml'
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
stack-yaml:
|
||||
# - 'stack/stack-8.2.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 ~/.stack
|
||||
with:
|
||||
path: ~/.stack
|
||||
key: ${{ runner.os }}-${{ matrix.stack-yaml }}-${{ hashFiles(format('./{0}', matrix.stack-yaml)) }}
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
export "NIX_PATH=nixpkgs=$(nix run .#print-nixpkgs-master)"
|
||||
stack build --nix --stack-yaml ${{matrix.stack-yaml}}
|
||||
|
||||
- name: Test
|
||||
if: ${{ !contains(fromJSON('["stack/stack-8.8.yaml"]'), matrix.stack-yaml) }}
|
||||
run: |
|
||||
export "NIX_PATH=nixpkgs=$(nix run .#print-nixpkgs-master)"
|
||||
stack test --nix --stack-yaml ${{matrix.stack-yaml}}
|
||||
|
||||
- name: Run integration test
|
||||
if: ${{ !contains(fromJSON('["stack/stack-8.8.yaml"]'), matrix.stack-yaml) }}
|
||||
run: |
|
||||
set -e
|
||||
|
||||
export "NIX_PATH=nixpkgs=$(nix run .#print-nixpkgs-master)"
|
||||
|
||||
nix build .#jupyterlab
|
||||
export PATH="$(pwd)/result/bin:$(pwd)/.local/bin:$PATH"
|
||||
|
||||
stack install --nix --stack-yaml ${{matrix.stack-yaml}}
|
||||
|
||||
ihaskell install --stack --stack-flag="--nix" --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
|
Loading…
x
Reference in New Issue
Block a user