-
Notifications
You must be signed in to change notification settings - Fork 38
100 lines (88 loc) · 2.85 KB
/
test.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Test Notebooks
on:
pull_request:
paths:
- notebooks/**
- binder/**
- '.github/workflows/'
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
name: Linux tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: "Install Conda environment with Micromamba"
uses: mamba-org/provision-with-micromamba@main
with:
cache-env: true
environment-file: binder/environment.yml
environment-name: nsidc-tutorials
- name: "Verify micromamba"
shell: bash -l {0}
run: |
micromamba info
jupyter kernelspec list
which python
conda list | sort
- name: "List updated notebooks"
id: changed-files
uses: tj-actions/changed-files@v36
with:
# since_last_remote_commit: true
separator: "\n"
files: |
**/*.ipynb
files_ignore: |
**/*endered*.ipynb
- name: "Verify that libraries used in notebooks are present in the environment"
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash -l {0}
run: |
find notebooks -type f -iname \*.ipynb -not -path '*\.ipynb_checkpoints/*' -not -path '*/iceflow/*' | xargs -I % python .github/workflows/scan_notebooks.py -n %
- name: "Setup Quarto"
uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.1.251
- name: "Execute notebooks with Quarto"
if: steps.changed-files.outputs.any_changed == 'true'
env:
EARTHDATA_USERNAME: ${{ secrets.EARTHDATA_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EARTHDATA_PASSWORD }}
shell: bash -l {0}
run: |
for notebook in ${{ steps.changed-files.outputs.added_files }}; do
echo "Executing ${notebook} ..."
quarto render $notebook --execute --execute-daemon
done
win-osx:
name: Runtime (${{ matrix.os }}, micromamba)
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: ["windows", "macos"]
include:
- os: windows
environment-file: binder/conda-win-64.lock
- os: macos
environment-file: binder/conda-osx-64.lock
steps:
- uses: actions/checkout@v3
- name: "Install Conda environment with Micromamba"
uses: mamba-org/provision-with-micromamba@main
with:
cache-env: true
environment-file: ${{ matrix.environment-file }}
environment-name: nsidc-tutorials
- name: "Verify micromamba"
shell: bash -l {0}
run: |
micromamba info
jupyter kernelspec list
printenv | sort