Skip to content

Merge pull request #40 from pmlmodelling/39-read-the-docs #71

Merge pull request #40 from pmlmodelling/39-read-the-docs

Merge pull request #40 from pmlmodelling/39-read-the-docs #71

Workflow file for this run

name: CI
on:
push:
branches: [ main]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 pyfvcom2 --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 pyfvcom2 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Check code formatting with black
# run: |
# black --check pyfvcom2/ tests/
# - name: Type check with mypy
# run: |
# mypy pyfvcom2/ --ignore-missing-imports
- name: Test package installation
run: |
python -c "import pyfvcom2; print(f'PyFVCOM2 version: {pyfvcom2.__version__}')"
- name: Run tests with pytest
run: |
# Run pytest with coverage, but don't fail if no tests found yet
pytest tests/ --cov=pyfvcom2 --cov-report=xml --cov-report=term-missing || echo "No tests found yet"
# - name: Upload coverage to Codecov
# if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
# uses: codecov/codecov-action@v3
# with:
# file: ./coverage.xml
# flags: unittests
# name: codecov-umbrella
# fail_ci_if_error: false