Skip to content

Testing

Testing #163

name: Testing
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
branches:
- '*'
schedule:
- cron: "0 13 * * 1"
jobs:
build-and-test:
name: Testing (Python ${{ matrix.python-version }}, 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, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
mkl-version: ['2023'] # currently 2024 fails building for some reason...
include:
- os: ubuntu-latest
python-version: "3.12"
coverage: ${{ true }}
- os: ubuntu-latest
python-version: "3.12"
mkl-version: '2024'
- os: windows-latest
python-version: "3.12"
mkl-version: '2024'
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
mamba-version: '*'
channels: conda-forge, defaults
channel-priority: true
activate-environment: dev
- name: Conda information
run: |
conda info
conda list
conda config --show
- name: Create environment
run: |
mamba install --quiet --yes pip numpy scipy cython mkl=${{ matrix.mkl-version }} pytest \
mkl-devel pkg-config meson-python meson ninja setuptools_scm \
${{ matrix.coverage && 'coverage' || ''}}
- 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="-Dcy_coverage=true"' || ''}}
conda list
- name: Run Tests
run: |
${{ matrix.coverage && 'coverage run -m' || '' }} pytest -s -v
${{ matrix.coverage && 'coverage xml' || '' }}
continue-on-error: ${{ matrix.os == 'windows-latest' && matrix.mkl-version == '2024'}}
- 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
mamba-version: '*'
channels: conda-forge, defaults
channel-priority: true
activate-environment: dev
- name: Install Env
run: |
conda info
conda list
conda config --show
- name: Create environment
run: |
mamba install --quiet --yes 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/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true