-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.63 KB
/
unit_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
name: unit tests
on:
push: # run on every push or PR to any branch
pull_request:
jobs:
python-unit:
name: Python unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
# Base python cache on the hash of requirements.txt file
# if the file changes, the cache is invalidated.
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
pip-${{ hashFiles('requirements.txt') }}
pip-
- name: Install python dependencies
run: pip install -r requirements.txt
- name: Install test dependencies
run: pip install pytest treon
- name: Run pytest for python utility code
run: python -m pytest
# run treon on specific notebooks for now, since not all are passing or need to be tested
- name: Run treon to check selected missing_data notebooks
run: treon missing_data/BorrowingCapacity.ipynb missing_data/MissingBorrowingActivity.ipynb missing_data/MissingBooks.ipynb missing_data/MissingMembers.ipynb missing_data/MissingMembershipActivities.ipynb missing_data/BookcatalogBooksEstimate.ipynb
- name: Run treon to check selected speculative_reading notebooks
run: treon speculative_reading/HemingwayBorrowing.ipynb speculative_reading/PartialBorrowers.ipynb speculative_reading/CombineRecommendations.ipynb speculative_reading/LenskitRecommendations.ipynb