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
|
name: PyRAF CI test
on: [push]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
tmp: /tmp/
TERM: dumb
PYRAF_NO_DISPLAY: no
strategy:
matrix:
include:
- name: Ubuntu 24.04 (Python-3.12.3), native
os: ubuntu-24.04
method: native
iraf: /usr/lib/iraf/
upload_coverage: yes
- name: Ubuntu 24.04 (Python-3.12.3), native, without IRAF
os: ubuntu-24.04
method: native
- name: Ubuntu 22.04 (Python-3.10), pip
os: ubuntu-22.04
iraf: /usr/lib/iraf/
method: pip
- name: macOS 26, pip
os: macos-26
method: pip
steps:
- name: Checkout repository
if: matrix.method == 'native'
uses: actions/checkout@v6
- name: Setup dependencies, Ubuntu/native
if: startsWith(matrix.os, 'ubuntu') && matrix.method == 'native'
run: |
sudo apt-get update
if [ "${{ matrix.iraf }}" ]; then
sudo apt-get install --no-install-recommends iraf iraf-noao iraf-dev
else
echo "PYRAF_NO_IRAF=yes" >> $GITHUB_ENV
fi
sudo apt-get install --no-install-recommends build-essential libx11-dev
sudo apt-get install --no-install-recommends python3-dev python3-pip python3-astropy python3-numpy-dev python3-setuptools python3-setuptools-scm python3-tk python3-pytest python3-pytest-cov ipython3
pip3 install "stsci.tools>=4.0.1" coveragepy
- name: Setup dependencies, Ubuntu/pip
if: startsWith(matrix.os, 'ubuntu') && matrix.method == 'pip'
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends iraf iraf-noao iraf-dev build-essential libx11-dev
sudo apt-get install --no-install-recommends python3-dev python3-pip python3-venv
pip3 install ipython
- name: Setup dependencies, Mac
if: startsWith(matrix.os, 'macos') && matrix.method == 'pip'
run: |
brew tap iraf-community/tap
brew install iraf
- name: Build PyRAF locally
if: matrix.method == 'native'
run: |
python3 setup.py build_ext -i
- name: Install PyRAF via pip
if: matrix.method == 'pip'
run: |
python3 -m venv /tmp/pyraf-venv
source /tmp/pyraf-venv/bin/activate
python3 -m pip install pytest git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA#egg=pyraf[test]
- name: Run tests (locally built)
if: matrix.method == 'native'
run: |
python3 -m pytest --cov=pyraf
- name: Run tests (installed package)
if: matrix.method == 'pip'
run: |
source /tmp/pyraf-venv/bin/activate
python3 -m pytest -s --pyargs pyraf
- name: "Upload coverage to Codecov"
if: matrix.upload_coverage == 'yes'
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false
|