Skip to content

Merge pull request #177 from iraf-community/python13 #694

Merge pull request #177 from iraf-community/python13

Merge pull request #177 from iraf-community/python13 #694

Workflow file for this run

name: PyRAF CI test
on: [push]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
tmp: /tmp/
iraf: ${{ matrix.iraf }}
TERM: dumb
PYRAF_NO_DISPLAY: no
strategy:
matrix:
include:
- name: Ubuntu 22.04 (Python-3.10), native
os: ubuntu-22.04
method: native
iraf: /usr/lib/iraf/
upload_coverage: yes
- name: Ubuntu 22.04 (Python-3.10), native, without IRAF
os: ubuntu-22.04
method: native
- name: Ubuntu 20.04 (Python-3.8.2), pip
os: ubuntu-20.04
method: pip
iraf: /usr/lib/iraf/
- name: macOS 13, pip
os: macos-13
method: pip
iraf: /Users/runner/work/iraf/
steps:
- name: Checkout repository
if: matrix.method == 'native'
uses: actions/checkout@v4
- name: Setup dependencies
if: startsWith(matrix.os, 'ubuntu') && matrix.method == 'native'
run: |
sudo apt-get update
if [ "$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
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
pip3 install ipython
- name: Setup dependencies, Mac
if: startsWith(matrix.os, 'macos') && matrix.method == 'pip'
run: |
mkdir $iraf
curl https://cloud.aip.de/index.php/s/iPj7LGxbRedYnqa/download/iraf-macintel.tar.gz | tar -C $iraf -x -z
(cd $iraf ; ./install < /dev/null || true)
export PATH=${HOME}/.iraf/bin:${PATH}
mkiraf -t=$TERM -n
echo "PATH=$PATH" >> $GITHUB_ENV
- 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: |
pip3 install 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: |
python3 -m pytest -s --pyargs pyraf
- name: "Upload coverage to Codecov"
if: matrix.upload_coverage == 'yes'
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false