Skip to content

Final tweak to enable the rest of the release CI #168

Final tweak to enable the rest of the release CI

Final tweak to enable the rest of the release CI #168

name: Python tests
on:
push:
tags-ignore:
- '**'
branches:
- '**'
pull_request:
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
test:
name: Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# see https://github.com/actions/runner-images?tab=readme-ov-file#available-images for runner types
os: [ubuntu-latest, macos-13, macos-14, macos-15] # macos-13 is x86_64, macos-14 & 15 are Arm64
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
exclude:
- os: macOS-14
python-version: 3.9
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: (macos) install automake and autoconf
if: ${{ startsWith(matrix.os, 'macOS') }}
run: |
brew install automake autoconf
- name: Install stable minimal toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup python environment and build mwalib Python module
run: |
echo "Run rust tests to generate test data"
cargo test --features cfitsio-static,examples
echo "Install Python deps"
pip3 install --upgrade pip
python3 -m venv env
source env/bin/activate
pip3 install --upgrade pip
pip3 install maturin pytest
echo "Build mwalib python module and test"
maturin develop --all-features --strip
pytest