Skip to content

MAINT: update test standards #331

MAINT: update test standards

MAINT: update test standards #331

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: Pytest with Flake8
on:
push:
pull_request:
schedule:
- cron: "0 3 * * 1" # Runs 03:00 UT on Mondays
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
numpy_ver: ["latest"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
include:
- python-version: "3.8"
numpy_ver: "1.21"
os: "ubuntu-latest"
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements for testing setup
run: pip install -r test_requirements.txt
- name: Install NEP29 dependencies
if: ${{ matrix.numpy_ver != 'latest'}}
run: |
pip install --no-binary :numpy: numpy==${{ matrix.numpy_ver }}
- name: Install standard dependencies
run: pip install -r requirements.txt
- name: Reinstall fortran on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew reinstall gcc
- name: Reinstall and set up MinGW-64 on Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: egor-tensin/setup-mingw@v1
with:
platform: x64
- name: Manually install sami2py
run: python setup.py install --user
- name: Test PEP8 compliance
run: flake8 . --count --select=D,E,F,H,W --show-source --statistics
- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Test with pytest
run: pytest --cov=sami2py/
- name: Publish results to coveralls
if: ${{ matrix.os == 'ubuntu-latest'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --rcfile=setup.cfg --service=github
- uses: codecov/codecov-action@v3