Skip to content

Add callbacks

Add callbacks #381

Workflow file for this run

name: Build, Check, and Test
on: [pull_request]
jobs:
build_and_test: # run lint, codestyle, docstyle, and incremental tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
python-version: [3.8, 3.9, '3.10', '3.11']
env:
MPLBACKEND: "agg"
PIPENV_VENV_IN_PROJECT: 1
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install pipenv
run: |
python3 -m pip install --upgrade pip
pip install pipenv
echo "HASH PIPFILE: ${{ hashFiles('Pipfile') }}"
- name: Cache dependencies
id: cache-dependencies
uses: tespkg/actions-cache@v1
with:
endpoint: s3.eu-central-1.wasabisys.com
insecure: false
accessKey: ${{ secrets.S3_ACCESS_KEY }}
secretKey: ${{ secrets.S3_SECRET_KEY }}
bucket: niapy-actions-cache
use-fallback: false
key: ${{ matrix.os }}_py${{ matrix.python-version }}-Pipfile_${{ hashFiles('Pipfile') }}
path: |
.venv
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
pipenv install --skip-lock --dev
- name: Lint with flake8
run: |
pipenv run flake8 niapy tests scent.py setup.py
- name: Check codestyle
run: |
pipenv run pycodestyle niapy tests scent.py setup.py --config=.pycodestyle.ini
- name: Check docstyle
run: |
pipenv run pydocstyle niapy tests scent.py setup.py
- name: Cache testmondata
uses: tespkg/actions-cache@v1
with:
endpoint: s3.eu-central-1.wasabisys.com
insecure: false
accessKey: ${{ secrets.S3_ACCESS_KEY }}
secretKey: ${{ secrets.S3_SECRET_KEY }}
bucket: niapy-actions-cache
use-fallback: false
key: testmondata-${{ matrix.os }}_py${{ matrix.python-version }}
path: |
config/testmondata
- name: Run incremental tests
env:
TESTMON_DATAFILE: config/testmondata/${{ matrix.os }}_py${{ matrix.python-version }}
shell: bash
run: |
echo "${TESTMON_DATAFILE}"
pipenv run pytest --testmon --suppress-no-test-exit-code -ra -vv --random --random-seed=32786 niapy tests
status=$?
if [ "$status" -eq 5 ]; then exit 0; else exit $status; fi