Merge pull request #19 from SimFin/dependabot/pip/tensorflow-2.11.1 #148
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |