-
Notifications
You must be signed in to change notification settings - Fork 65
56 lines (47 loc) · 1.76 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
name: Test All Notebooks
# Run this GitHub action on a schedule using the cron.
on:
push
#schedule:
# Every day at 08:00 UTC, one hour after datasets are updated on server.
#- cron: "0 8 * * *"
# Every 5 minutes for testing, as it cannot be triggered manually.
#- cron: "*/5 * * * *"
jobs:
test:
# We currently only test with the latest ubuntu version.
runs-on: ubuntu-latest
steps:
# Checkout the repo from GitHub to a temporary work-directory.
- name: Checkout GitHub repository
uses: actions/checkout@v1
# Use a cache for the pip install to avoid reinstalling every time this is run.
# Note: This is currently not supported for cron schedule. https://github.com/actions/cache/issues/63
- name: Cache pip install
uses: actions/cache@v1
id: cache
with:
path: .cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Run with a Python version that we know works.
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
# Install all requirements to run these tests.
- name: Install requirements
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest nbval
# Ensure the SimFin data-dir is removed.
# It is unclear from the docs exactly how the cache works, so we make sure
# the SimFin data-files are deleted, in case they have been cached.
- name: Delete SimFin data-dir
run: rm -rf ~simfin_data
# Run the actual tests of all the Python Notebooks.
- name: Test All Notebooks
run: pytest --nbval-lax -v *.ipynb