-
Notifications
You must be signed in to change notification settings - Fork 13
63 lines (63 loc) · 1.97 KB
/
CI.yml
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
name: CI
on:
- push
- pull_request
jobs:
notebooks:
name: List Notebooks
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.notebooks.outputs.value }}
steps:
- uses: actions/checkout@v2
- name: List Notebooks as JSON
uses: sergeysova/jq-action@v2
id: notebooks
with:
cmd: 'ls *.ipynb | jq -R . | jq -sc .'
- run: 'echo "${{steps.notebooks.outputs.value}}"'
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.notebook }}
needs: notebooks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version:
- '1.6'
python-version:
- '3.x'
os:
- ubuntu-latest
arch:
- x64
notebook: ${{ fromJSON(needs.notebooks.outputs.matrix) }}
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.arch }}
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Set up Julia project
# Although IJulia is in Project.toml, it won't be available to Jupyter unless we do something to force it.
run: julia -e 'using Pkg; Pkg.activate("."); Pkg.instantiate()'
- run: pip install
nbconvert
matplotlib
- name: Run notebooks
run: |
v=julia-`julia -e 'print("$(VERSION.major).$(VERSION.minor)")'`
jupyter nbconvert --ExecutePreprocessor.kernel_name="$v" --to=notebook --execute ${{ matrix.notebook }}