forked from InstituteforDiseaseModeling/covasim
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.78 KB
/
test.yaml
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
name: Covasim CI workflow
on: [pull_request]
jobs:
install_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 8
matrix:
python-version: ['3.7']
name: Run tests
steps:
- name: Set repo owner env variable
shell: python
run: print("::set-env name=GITHUB_OWNER::{}".format('${{github.repository}}'.split('/')[0]))
- name: Set PYTHONPATH
run: |
mkdir -p $HOME/.cache/site-packages
echo "::set-env name=PYTHONPATH::$HOME/.cache/site-packages"
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Cache Packages
id: cache-packages
uses: actions/cache@v1
with:
path: ~/.cache/ # This path is specific to Ubuntu
key: packages-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }} # Look to see if there is a cache hit for the corresponding requirements file
restore-keys: |
packages-${{ runner.os }}-${{ matrix.python-version }}- # Pip install first will make setup.py much faster and the cache will make pip install fast
- name: Install Covasim
run: |
python setup.py develop --install-dir ~/.cache/site-packages
pip install pytest
- name: Run integration tests
working-directory: ./tests
run: pytest test*.py --durations=0 # Run actual tests
- name: Run unit tests
working-directory: ./tests/unittests
run: pytest test*.py --durations=0 # Run actual tests
- name: Run cruise ship tests
working-directory: ./covasim/cruise_ship
run: pytest test*.py