piku/.github/workflows/core-tests.yml

43 wiersze
1.5 KiB
YAML

name: Basic Test Suite and Linting
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
matrix:
# This is currently overkill since we are targeting 3.5
# but affords us visibility onto syntax changes in newer Pythons
python-version: [3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Check execution
run: |
python piku.py
- name: Check if setup works in-place
run: |
python piku.py setup
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Notes:
# --exit-zero treats all errors as warnings, but we don't use it anymore
# Allow longer lines for inlining SSH entries and set a complexity threshold that will pass for now
# Ignore W605 (https://lintlyci.github.io/Flake8Rules/rules/W605.html) because
# flake8 does not understand escaping dots inside templates for nginx and SSH
# TODO: pare down complexity and line length as we shrink piku core
flake8 . --ignore=W605 --count --max-complexity=60 --max-line-length=255 --statistics