Skip to content

CI

CI #181

Workflow file for this run

on:
# Trigger the workflow on push or
# pull request, but only for the
# main branch.
push:
branches:
- main
pull_request:
branches:
- main
# Allow manual triggering
workflow_dispatch:
# Weekly run to account for
# changed dependencies.
schedule:
- cron: '17 03 * * 0'
name: CI
permissions: # added using https://github.com/step-security/secure-repo
contents: read
jobs:
build:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- 'pypy-3.7'
- 'pypy-3.8'
- 'pypy-3.9'
- 'pypy-3.10'
include:
# Python < 3.10 is not available on macOS 14
- os: macos-14
python-version: '3.10'
- os: macos-14
python-version: '3.11'
- os: macos-14
python-version: '3.12'
- os: macos-14
python-version: 'pypy-3.8'
- os: macos-14
python-version: 'pypy-3.9'
- os: macos-14
python-version: 'pypy-3.10'
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v4
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: v2-pip-${{ runner.os }}-${{ matrix.python-version }}
restore-keys: |
v2-pip-${{ runner.os }}
v2-pip-
- name: Install dependencies
run: |
pip install setuptools
pip install pytest
pip install sphinx
pip install myst-parser
- name: Build the code
run: python ./setup.py build_ext -i
- name: Run tests
run: python -m pytest tests
- name: Cleanup
run: make clean
- name: Re-build with coverage info
run: CFLAGS="-coverage" python ./setup.py build_ext -i
- name: Test with coverage
run: python -m pytest tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
#files: ./coverage1.xml,./coverage2.xml
#directory: ./coverage/reports/
#flags: unittests
#env_vars: OS,PYTHON
name: codecov-python-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
#fail_ci_if_error: true
#verbose: true
- name: Build documentation
run: make doc