-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (44 loc) · 1.62 KB
/
python-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This workflow will install Python dependencies, run tests, lint, and upload a report to codecov on selected branches
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches: '*'
pull_request:
branches: '*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov pytest-repeat
cd src && pip install -r requirements.txt
- name: Flake8 Annotator
uses: rbialon/flake8-annotations@v1
- name: Lint with flake8
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. CTFOJ uses 90 characters per line as the limit for Python code.
flake8 . --count --exit-zero --ignore=F405,W503 --max-complexity=10 --max-line-length=90 --statistics
- name: Test and generate coverage report with pytest
run: |
git rm src/migrate.py
cd src && python -m pytest -v --cov=./ --cov-report=xml --count 2
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: src/coverage.xml
flags: unittests
env_vars: OS, PYTHON