Merge #1883 (DougBurke) - Update setup_ds9.sh for DS9 8.5 #109
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: Conda CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
env: | |
xspec_channel: "xspec/label/test" | |
CONDA_BUILD_SYSROOT: ${{ github.workspace }}/10.14SDK/MacOSX10.14.sdk | |
jobs: | |
tests: | |
defaults: | |
run: | |
shell: bash | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- name: MacOS Full Build | |
os: macos-latest | |
python-version: "3.10" | |
install-type: develop | |
fits: astropy | |
test-data: submodule | |
matplotlib-version: 3 | |
xspec-version: 12.13.1 | |
# run xvfb with this display | |
display: :99 | |
- name: Linux Minimum Setup (Python 3.9) | |
os: ubuntu-latest | |
python-version: "3.9" | |
numpy-version: "1.21" | |
install-type: develop | |
test-data: none | |
- name: Linux Minimum Setup (Python 3.11) | |
os: ubuntu-latest | |
python-version: "3.11" | |
numpy-version: "1.23" | |
install-type: develop | |
test-data: none | |
- name: Linux Full Build (Python 3.11) | |
os: ubuntu-latest | |
python-version: "3.11" | |
install-type: develop | |
fits: astropy | |
test-data: submodule | |
matplotlib-version: 3 | |
xspec-version: 12.13.1 | |
- name: Linux Full Build (Python 3.10) | |
os: ubuntu-latest | |
python-version: "3.10" | |
install-type: develop | |
fits: astropy | |
test-data: submodule | |
matplotlib-version: 3 | |
xspec-version: 12.13.0c | |
- name: Linux Full Build (Python 3.9) | |
os: ubuntu-latest | |
python-version: "3.9" | |
install-type: develop | |
fits: astropy | |
test-data: submodule | |
matplotlib-version: 3 | |
xspec-version: 12.12.0g | |
- name: Linux Build (w/o Astropy or Xspec) | |
os: ubuntu-latest | |
python-version: "3.11" | |
install-type: install | |
test-data: package | |
matplotlib-version: 3 | |
- name: Linux Build (w/o Matplotlib, Xspec, or test data) | |
os: ubuntu-latest | |
python-version: "3.9" | |
numpy-version: "1.21" | |
install-type: develop | |
fits: astropy | |
test-data: none | |
steps: | |
- name: Checkout Code | |
uses: actions/[email protected] | |
with: | |
submodules: 'True' | |
# https://stackoverflow.com/questions/63648591/how-to-install-x11-before-testing-with-github-actions-for-macos | |
- name: Install XQuartz on macOS | |
if: runner.os == 'macOS' | |
run: | | |
brew install --cask xquartz | |
- name: Conda Setup | |
env: | |
PYTHONVER: ${{ matrix.python-version }} | |
NUMPYVER: ${{ matrix.numpy-version }} | |
FITSBUILD: ${{ matrix.fits }} | |
MATPLOTLIBVER: ${{ matrix.matplotlib-version }} | |
XSPECVER: ${{ matrix.xspec-version }} | |
run: | | |
source .github/scripts/setup_conda.sh | |
- name: Conda Setup (Xspec and DS9) | |
if: matrix.xspec-version != '' | |
env: | |
XSPECVER: ${{ matrix.xspec-version }} | |
run: | | |
source ${CONDA}/etc/profile.d/conda.sh | |
conda activate build | |
source .github/scripts/setup_ds9.sh | |
source .github/scripts/setup_xspec.sh | |
- name: Start Xvfb (macOS) | |
if: runner.os == 'macOS' | |
env: | |
DISPLAY: ${{ matrix.display }} | |
run: | | |
sudo /opt/X11/bin/Xvfb ${DISPLAY} -ac -screen 0 1024x768x8 & | |
- name: Build Sherpa (install) | |
if: matrix.install-type == 'install' | |
env: | |
PYTHON_LDFLAGS: " " | |
run: | | |
source ${CONDA}/etc/profile.d/conda.sh | |
conda activate build | |
pip install . --verbose | |
- name: Build Sherpa (develop) | |
if: matrix.install-type == 'develop' | |
env: | |
PYTHON_LDFLAGS: " " | |
run: | | |
source ${CONDA}/etc/profile.d/conda.sh | |
conda activate build | |
pip install -e . --verbose | |
- name: Install the test data? | |
if: matrix.test-data == 'package' | |
run: | | |
source ${CONDA}/etc/profile.d/conda.sh | |
conda activate build | |
pip install ./sherpa-test-data | |
pip install pytest-xvfb | |
- name: Remove submodule | |
if: matrix.test-data == 'none' || matrix.test-data == 'package' | |
run: | | |
git submodule deinit -f . | |
# run the smoke test first as it's small/quick to do | |
- name: Smoke Tests | |
env: | |
XSPECVER: ${{ matrix.xspec-version }} | |
FITS: ${{ matrix.fits }} | |
run: | | |
if [ -n "${XSPECVER}" ]; then XSPECTEST="-x -d"; fi | |
if [ -n "${FITS}" ] ; then FITSTEST="-f ${FITS}"; fi | |
smokevars="${XSPECTEST} ${FITSTEST} -v 3" | |
echo "** smoke test: ${smokevars}" | |
source ${CONDA}/etc/profile.d/conda.sh | |
conda activate build | |
cd /home | |
sherpa_smoke ${smokevars} | |
- name: Internal check | |
if: matrix.test-data == 'submodule' && matrix.install-type != 'develop' | |
env: | |
INSTALLTYPE: ${{ matrix.install-type }} | |
run: | | |
# At the moment "Submodule Tests" requires the develop | |
# install-type, otherwise the "python setup.py test" call will | |
# lead to the develop build to be re-run, meaning that the | |
# install option is not tested. When we change to pytest we | |
# can switch to something like 'cd $HOME; pytest sherpa' | |
# | |
echo "ERROR: submodule test can not be run with install-type=${INSTALLTYPE}" | |
exit 1 | |
- name: Submodule Tests | |
if: matrix.test-data == 'submodule' | |
env: | |
INSTALLTYPE: ${{ matrix.install-type }} | |
run: | | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
# make sure pytext-xvfb can find Xvfb | |
export PATH="${PATH}:/opt/X11/bin" | |
fi | |
source ${CONDA}/etc/profile.d/conda.sh | |
conda activate build | |
conda install -yq pytest-cov | |
python setup.py -q test -a "--cov sherpa --cov-report xml" | |
- name: sherpa_test Tests | |
if: matrix.test-data == 'package' || matrix.test-data == 'none' | |
run: | | |
source ${CONDA}/etc/profile.d/conda.sh | |
conda activate build | |
conda install -yq pytest-cov | |
cd $HOME | |
sherpa_test --cov sherpa --cov-report xml | |
- name: upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
# only select the reports that we know are coverage reports, from linux conda, mac conda, and pip | |
files: /home/runner/work/sherpa/sherpa/coverage.xml,/Users/runner/work/sherpa/sherpa/coverage.xml,/home/runner/coverage.xml | |
verbose: true |