forked from projectglow/glow
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 2.04 KB
/
noteook-tests.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
name: Notebook-tests
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
notebook-tests:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
conda-solver: libmamba
activate-environment: glow
- name: Cache Conda env
uses: actions/cache@v4
with:
path: /usr/share/miniconda/envs/glow
key:
conda-${{ hashFiles('python/environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run:
conda env update -n glow -f python/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Configure Databricks CLI
run: |
cat <<EOF >$HOME/.databrickscfg
[docs-ci]
host = https://adb-984752964297111.11.azuredatabricks.net
token = $DATABRICKS_API_TOKEN
jobs-api-version = 2.1
EOF
env:
DATABRICKS_API_TOKEN: ${{ secrets.DATABRICKS_API_TOKEN }}
- name: Generate notebook source files
run: |
export PATH=$HOME/conda/envs/glow/bin:$PATH
for f in $(find docs/source/_static/notebooks -type f -name '*.html'); do
python docs/dev/gen-nb-src.py --html "${f}" --cli-profile docs-ci
done
- name: Verify that repo is clean
run: |
if [[ -n $(git status --short) ]]; then
echo "Working directory was not clean!"
git status
false
else
true
fi
- name: Run all notebook tests
run: |
python docs/dev/run-nb-test.py --cli-profile docs-ci