forked from sherpa/sherpa
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (126 loc) · 3.92 KB
/
ci-pip-workflow.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Pip CI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
#Reduces GH Action duplication:
# Cancels the previous pipeline for this ref it is still running
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
defaults:
run:
shell: bash
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: Linux Minimum Setup
os: ubuntu-latest
python-version: "3.10"
numpy-pkg: 'numpy>=1.24,<1.25'
install-type: develop
test-data: none
- name: Linux Build (w/o Xspec; Python 3.11)
os: ubuntu-latest
python-version: "3.11"
numpy-pkg: 'numpy'
install-type: install
test-data: package
fits-pkg: 'astropy'
matplotlib-pkg: 'matplotlib>=3,<4'
bokeh-pkg: 'bokeh>=3,<4'
- name: Linux Build (w/o Astropy or Xspec)
os: ubuntu-latest
python-version: "3.11"
numpy-pkg: 'numpy'
install-type: install
test-data: package
matplotlib-pkg: 'matplotlib>=3,<4'
bokeh-pkg: 'bokeh>=3,<4'
- name: Linux Build (w/o Matplotlib, Xspec, or test data)
os: ubuntu-latest
python-version: "3.10"
numpy-pkg: 'numpy'
install-type: develop
fits-pkg: 'astropy'
test-data: none
- name: Linux Build (submodule data w/o Matplotlib or Xspec)
os: ubuntu-latest
python-version: "3.12"
numpy-pkg: 'numpy'
install-type: develop
fits-pkg: 'astropy'
test-data: submodule
steps:
- name: Checkout Code
uses: actions/[email protected]
with:
submodules: 'True'
- name: Pip Testing Setup - Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Pip Testing Setup - Dependencies
env:
NUMPYVER: ${{ matrix.numpy-pkg }}
FITSBUILD: ${{ matrix.fits-pkg }}
MATPLOTLIBVER: ${{ matrix.matplotlib-pkg }}
BOKEHVER: ${{ matrix.BOKEH-pkg }}
run: |
# In case we forget to set matrix.numpy-pkg
if [ ! -n "${NUMPYVER}" ] ; then
NUMPYVER='numpy'
fi
pip install ${NUMPYVER} ${FITSBUILD} ${MATPLOTLIBVER} ${BOKEHVER}
- name: Build Sherpa (install)
if: matrix.install-type == 'install'
run: |
pip install . --verbose
- name: Build Sherpa (develop)
if: matrix.install-type == 'develop'
run: |
pip install -e . --verbose
- name: install pytest-xvfb
if: matrix.test-data == 'package'
run: |
pip install pytest-xvfb
- name: sherpa_test with test-data=${{ matrix.test-data }}
if: matrix.test-data == 'package' || matrix.test-data == 'none'
env:
TEST: ${{ matrix.test-data }}
run: |
git submodule deinit -f .
pip install pytest-cov
cd $HOME
sherpa_test --cov=sherpa --cov-report=xml:${{ github.workspace }}/coverage.xml
- name: Submodule test with pytest
if: matrix.test-data == 'submodule'
run: |
pip install -r test_requirements.txt
pip install pytest-cov
cd $HOME
pytest --cov=sherpa --cov-report=xml:${{ github.workspace }}/coverage.xml
- name: upload coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/coverage.xml
verbose: true
- name: Smoke Test
env:
FITS: ${{ matrix.fits-pkg }}
run: |
smokevars="-v 3"
if [ ${FITS} != '' ] ; then
smokevars="-f ${FITS} ${smokevars}"
fi
echo "** smoke test: ${smokevars}"
cd ${HOME}
sherpa_smoke ${smokevars}