Merge pull request #42 from bf777/dev #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from https://github.com/DeepLabCut/DeepLabCut/blob/master/.github/workflows/python-package.yml | |
name: Python package | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
MESONET_GIT: ${{ github.workspace }} | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.10"] | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
- os: windows-latest | |
path: ~\AppData\Local\pip\Cache | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prints environment variable for git repo location | |
run: echo "The MesoNet git repository is located at ${{ env.MESONET_GIT }}" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install h5py | |
python -m pip install flake8 | |
python -m pip install . | |
- name: Lint with flake8 | |
working-directory: ./mesonet | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Run shell script to install models from OSF | |
working-directory: ./mesonet | |
run: sh get_default_models.sh | |
- name: Run functional tests | |
working-directory: ./tests | |
run: python test.py |