Skip to content

reformatted

reformatted #637

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Build and test
on:
workflow_dispatch:
push:
branches: [dev_alban, dev_thomas, master, pre_deploy_1.1]
pull_request:
branches: [dev_alban, dev_thomas, master, pre_deploy_1.1]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
#----------------------------------------------
# ----- install & configure conda
#----------------------------------------------
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
conda-build-version: "*"
channels: conda-forge,defaults
channel-priority: true
- shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- shell: bash -l {0}
run: |
conda env update -n test --file environment.yml
- name: Create mongoDB Docker container
run: sudo docker run -d -p 27017:27017 mongo:latest
#----------------------------------------------
# Code quality check
#----------------------------------------------
- name: Lint with flake8
shell: bash -l {0}
run: |
conda info
conda activate test
# stop the build if there are Python syntax errors or undefined names
flake8 . --exclude=.venv,.git --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --exclude=.venv,.git --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
shell: bash -l {0}
run: |
conda info
conda activate test
coverage run --omit '.venv/*' -m pytest tests
coverage report -m