-
Notifications
You must be signed in to change notification settings - Fork 15
71 lines (67 loc) · 2.41 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
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
name: tests and docs
# branch filtering:
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# workflows running on Linux and MacOS have passwordless sudo rights:
# https://stackoverflow.com/questions/57982945/how-to-apt-get-install-in-a-github-actions-workflow
on: push
jobs:
test:
name: Run Unit Tests
runs-on: ubuntu-20.04
defaults:
run:
# pinning the shell name helps to properly set conda
shell: bash -l {0}
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9]
env:
OMP_NUM_THREADS: 2
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup conda for Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
python-version: ${{ matrix.python-version }}
channels: conda-forge
allow-softlinks: true
channel-priority: flexible
show-channel-urls: true
use-only-tar-bz2: true
- name: Print conda config
run: |
conda info
conda list
conda config --show-sources
conda config --show
- name: Install FFTW3
run: sudo apt-get install libfftw3-dev
- name: Build and install galario, build docs
run: |
conda activate test
conda install astropy cython nomkl numpy pytest scipy sphinx
pip install coverage codecov pytest-cov
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/tmp -DCMAKE_PREFIX_PATH=${CONDA_PREFIX} ..
make
make install
- name: Run unit tests
run: python/py.test.sh -sv --cov=./ python/test_galario.py
working-directory: build
- name: Upload code coverage report
run: bash <(curl -s https://codecov.io/bash) || echo 'Codecov failed to upload'
- name: build docs
run: |
conda activate test
pip install sphinx_py3doc_enhanced_theme sphinxcontrib-fulltoc
cd build
make docs
- name: deploy docs
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.7'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/docs/html # The folder the action should deploy.
dry-run: false