-
Notifications
You must be signed in to change notification settings - Fork 16
67 lines (57 loc) · 1.76 KB
/
python-tests.yml
File metadata and controls
67 lines (57 loc) · 1.76 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Python Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install CLASS dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential gfortran
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install Cython
pip install -r requirements.txt
- name: Install CLASS
run: |
git clone https://github.com/lesgourg/class_public.git
cd class_public
make
cd python
python setup.py install
cd ../../
# Keep the directory for data files
- name: Install package
run: |
pip install -e .
- name: Debug SFR_III function
env:
CLASSDIR: ${{ github.workspace }}/class_public
run: |
python -c "import zeus21; from zeus21.sfrd import SFR_III; import inspect; print('SFR_III parameters:', inspect.signature(SFR_III)); print('Parameter count:', len(inspect.signature(SFR_III).parameters))"
- name: Run tests with coverage
env:
CLASSDIR: ${{ github.workspace }}/class_public
run: |
python -m pytest --cov=zeus21 --cov-report=xml --cov-report=term tests/
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true
fail_ci_if_error: false