-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (65 loc) · 2.29 KB
/
python-app.yml
File metadata and controls
80 lines (65 loc) · 2.29 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# 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: Python application
on:
push:
branches-ignore:
- docs*
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: 'true'
- name: Update Submodules
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Set up Poetry
uses: snok/install-poetry@v1
with:
version: 1.1.10
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: ~/.cache/virtualenvs
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: ~/.cache/virtualenvs
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 --count --exit-zero --max-complexity=11 --max-line-length=127 --statistics
- name: Lint with mypy
run: |
poetry run mypy .
- name: PyTest + coverage
run: |
poetry run python main.py confgen -p .
poetry run python -m pytest --ignore=tests/tracing --cov --cov-report xml:reports/coverage/coverage.xml
poetry run python -m coverage report
- name: PyTest + sys.settrace
run: |
poetry run python -m pytest tests/tracing
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: coverage-report
path: reports/coverage/coverage.xml