Skip to content

Merge pull request #1 from High-Performance-IO/unit-tests #5

Merge pull request #1 from High-Performance-IO/unit-tests

Merge pull request #1 from High-Performance-IO/unit-tests #5

Workflow file for this run

name: CI Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
cmake \
ninja-build \
libopenmpi-dev \
openmpi-bin
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade build tooling
run: python -m pip install --upgrade pip setuptools wheel
- name: Build and install PyCAPIO from source
run: pip install . --verbose
- name: Install test dependencies
run: |
pip install -r tests/requirements.txt
pip install pytest-cov
- name: Run test suite with coverage
working-directory: tests
run: |
pytest -v \
--cov=pycapio \
--cov-report=xml \
--cov-report=term-missing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: tests/coverage.xml
flags: python-${{ matrix.python-version }}
name: pycapio-py${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build sdist
run: |
python -m pip install --upgrade pip build twine
python -m build --sdist
python -m twine check dist/*
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz