Skip to content

MAINT: Bugs and updates #262

MAINT: Bugs and updates

MAINT: Bugs and updates #262

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a
# variety of Python versions. For more information see:
# https://help.github.com/actions/language-and-framework-guides/
# using-python-with-github-actions
name: unittest with flake8
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
install-extras: [0, 1, 2] # TODO(#129): update to replace extra flag
exclude:
- os: windows-latest
install-extras: 2
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with extras ${{ matrix.install-extras }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set CDF Lib environment variable
if: ${{ matrix.install-extras == 2 }}
run: echo "CDF_LIB=$HOME/lib" >> $GITHUB_ENV
- name: Install standard and test dependencies, then ocbpy for SSJ
if: ${{ matrix.install-extras == 2 }}
env:
CDF_LIB: $HOME/lib
run: |
pip install .[test]
bash requirements.extra ${{ matrix.install-extras }}
- name: Install standard and test dependencies, then ocbpy without SSJ
if: ${{ matrix.install-extras != 2 }}
run: |
pip install .[test]
bash requirements.extra ${{ matrix.install-extras }}
- name: Test PEP8 compliance
run: flake8 . --count --show-source --statistics
- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Run unit and integration tests
run: coverage run --rcfile=pyproject.toml -m unittest discover
- name: Publish results to coveralls upon success
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.install-extras }}
run: coveralls --rcfile=pyproject.toml --service=github || true
finish:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Coveralls Finished
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install --upgrade coveralls
coveralls --service=github --finish || true