-
Notifications
You must be signed in to change notification settings - Fork 47
74 lines (73 loc) · 2.6 KB
/
workflow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Continuous integration
on:
- push
- pull_request
jobs:
build:
name: Build - Windows
runs-on: windows-latest
steps:
- name: Install dependencies
run: |
choco install -y haskell-stack
choco install -y r --version 4.0.0
- uses: actions/checkout@v1
- name: Get Stack snapshot install directory
id: stack-snapshot
run: |
stack path --snapshot-install-root
echo "::set-output name=dir::$(stack path --snapshot-install-root)"
- uses: actions/cache@v1
with:
path: ${{ steps.stack-snapshot.outputs.dir }}
key: ${{ steps.stack-snapshot.outputs.dir }}-${{ hashFiles('**/*.cabal') }}
restore-keys: |
${{ runner.os }}-stack-
- name: Build
run: |
stack build inline-r H `
--extra-lib-dirs="C:/Program files/R/R-4.0.0/bin/x64" `
--extra-include-dirs="C:/Program files/R/R-4.0.0/include"
test:
name: Build & Test - ${{ matrix.os }} - ${{ matrix.stack_yaml }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
stack_yaml: [stack.yaml, stack-lts-18.yaml, stack-lts-19.yaml]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=./nixpkgs.nix
- name: Install Stack
run: |
nix-env -f. -iA nixpkgs.stack
- name: Get Stack snapshot install directory
id: stack-snapshot
run: |
# XXX Workaround
# https://github.com/commercialhaskell/stack/issues/5028.
[ ${{ matrix.stack_yaml }} = stack.yaml ] || mv ${{ matrix.stack_yaml }} stack.yaml
stack --nix path --snapshot-install-root
echo "::set-output name=dir::$(stack --nix path --snapshot-install-root)"
- uses: actions/cache@v2
with:
path: ${{ steps.stack-snapshot.outputs.dir }}
key: ${{ steps.stack-snapshot.outputs.dir }}-${{ hashFiles('**/*.cabal') }}
restore-keys: |
${{ steps.stack-snapshot.outputs.dir }}
- name: Build
run: |
stack --nix build
- name: Test
if: ${{ runner.os == 'Linux' }}
run: |
stack --nix test
- name: Test IHaskell jupyter notebook example
if: ${{ runner.os == 'Linux' }}
run: |
stack --nix install
export PATH=~/.local/bin:$PATH
stack --nix exec -- ihaskell install
stack --nix exec -- jupyter nbconvert --to notebook --execute --inplace ./IHaskell/examples/tutorial-ihaskell-inline-r.ipynb