-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (42 loc) · 1.34 KB
/
Copy pathunit_test.yml
File metadata and controls
45 lines (42 loc) · 1.34 KB
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: Python unit tests
on: [push]
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
max-parallel: 5
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
conda config --add channels conda-forge
- name: Install dependencies
run: |
conda update pip setuptools
conda install numpy astropy bilby python-lal python-lalsimulation
conda install pytest-cov
pip install .
- name: Test with pytest
run: |
pytest --cov=gpucbc -ra --color yes --cov-report=xml --junitxml=pytest.xml
- name: Publish coverage to Codecov
uses: codecov/codecov-action@v1.2.1
with:
files: coverage.xml
flags: python${{ matrix.python-version }}
- name: Coverage report
run: python -m coverage report --show-missing
- name: Upload test results
if: always()
uses: actions/upload-artifact@v2
with:
name: pytest-${{ matrix.python-version }}
path: pytest.xml