Skip to content

Maintenance on pydiso #225

Maintenance on pydiso

Maintenance on pydiso #225

name: Testing
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: Testing (Python ${{ matrix.python-version }}${{ matrix.free-threaded && 't' || '' }}, on ${{ matrix.os }}, with MKL ${{ matrix.mkl-version }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: False
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
mkl-version: ['2024', '2025']
free-threaded: [true, false]
include:
- os: ubuntu-latest
python-version: "3.12"
coverage: ${{ true }}
- os: macos-15-intel
python-version: "3.11"
mkl-version: "2023"
free-threaded:
- os: macos-15-intel
python-version: "3.12"
mkl-version: "2023"
free-threaded:
exclude:
- python-version: "3.11"
free-threaded: true
- python-version: "3.12"
free-threaded: true
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge, defaults
channel-priority: true
activate-environment: dev
- name: Create environment
run: |
conda install --quiet --yes -c conda-forge \
${{ matrix.free-threaded && 'python-freethreading' || 'python' }}=${{ matrix.python-version }} \
pip numpy scipy cython mkl=${{ matrix.mkl-version }} pytest \
mkl-devel pkg-config meson-python meson ninja setuptools_scm \
${{ matrix.coverage && 'coverage' || ''}} \
${{ matrix.os == 'windows-latest' && '"libblas=*=*mkl"' || ''}}
- name: Conda information
run: |
conda info
conda list
conda config --show
- name: Install Our Package
run: |
python -m pip install --no-build-isolation --verbose --editable . \
--config-setting=compile-args=-v \
${{ matrix.coverage && '--config-settings=setup-args="-Db_coverage=true"' || ''}} \
${{ matrix.os == 'windows-latest' && '--config-settings=setup-args="-Dvsenv=true"' || ''}}
conda list
- name: Run Tests
run: |
${{ matrix.coverage && 'coverage run -m' || '' }} pytest -s -v
${{ matrix.coverage && 'coverage xml' || '' }}
- name: Upload coverage
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v4
with:
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }} # required
distribute:
name: Distributing from 3.11
needs: build-and-test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
channels: defaults
channel-priority: true
activate-environment: dev
- name: Install Env
run: |
conda info
conda list
conda config --show
- name: Create environment
run: |
conda install --quiet --yes -c conda-forge \
pip numpy scipy cython mkl=2023 \
mkl-devel pkg-config meson-python meson ninja setuptools_scm \
python-build
- name: Generate Source Distribution
run: |
python -m build --no-isolation --skip-dependency-check --sdist .
- name: pypi-publish
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true