Skip to content

Add NumPy 2.0 to testing #151

Add NumPy 2.0 to testing

Add NumPy 2.0 to testing #151

name: Continuous Integration
on:
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Save a bit of resources by running only some combinations:
# Windows 3.11; macOS 3.10; Ubuntu 3.12
# Additionally, macOS on ARM processor is tested
# Code coverage, SonarCloud and test package build are only done once
include:
- os: ubuntu-latest
python-version: '3.12'
analysis: true
- os: windows-latest
python-version: '3.11'
analysis: false
- os: macos-latest
python-version: '3.10'
analysis: false
- os: macos-14
python-version: '3.12'
analysis: false
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
pip install -e .[dev]
- name: Run unit tests (with coverage)
if: matrix.analysis == true
# We have to rename the path in coverage.xml since Sonar is run in Docker
# and has a different view of the file system
run: |
pip install pytest-cov
python -m pytest tests/unit/ --cov=ennemi --cov-report=xml --junit-xml=test-results.xml
sed 's/\/home\/runner\/work\/ennemi\/ennemi/\/github\/workspace/g' coverage.xml > coverage-mod.xml
- name: Run unit tests (no coverage)
if: matrix.analysis != true
run: |
python -m pytest tests/unit/ --junit-xml=test-results.xml
- name: Try building the package
if: matrix.analysis == true
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel
- name: Run type checker
run: |
python -m mypy ennemi/ tests/unit tests/integration tests/pandas
- name: Run Sonar code analysis
if: matrix.analysis == true
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}