Merge #2154 (anetasie) - Update README #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |