Skip to content

Build and test

Build and test #28

name: Build and test
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ "ubuntu-latest", "macos-latest" ]
python-version: [ "3.8", "3.10", "3.12", "3.14" ]
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
python -m pip install pytest pytest-cov
- name: Run tests (no coverage upload)
run: |
pytest
- name: Run tests with coverage (for Coveralls)
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
run: |
pytest --cov=cbicall --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Coveralls
if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
format: cobertura
file: coverage.xml