-
-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (75 loc) · 2.52 KB
/
python.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
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
81
82
83
84
85
86
87
88
89
90
91
name: Python
on:
push:
# branches: ["main"]
pull_request:
# branches: ["main"]
workflow_dispatch:
# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
env:
mode: testing
envfile: ${{secrets.ENV}}
"POETRY_VIRTUALENVS_IN_PROJECT": false
"POETRY_VIRTUALENVS_OPTIONS_ALWAYS_COPY": true
"POETRY_VIRTUALENVS_OPTIONS_NO_PIP": false
"POETRY_VIRTUALENVS_OPTIONS_NO_SETUPTOOLS": false
"DATA_DIR": "${{github.workspace}}/data"
jobs:
build:
strategy:
fail-fast: false
max-parallel: 2
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11"]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }} on ${{matrix.os}}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
cache-dependency-path: |
**/setup.cfg
**/requirements*.txt
poetry.lock
pyproject.toml
- name: Write environment
run: |
echo $envfile > .env
sed -i 's/ /\n/g' .env
source .env
- name: Install dependencies
run: |
#make install
#make install-tests
# poetry config settings.virtualenvs.create false --local
poetry install --no-root
source $(poetry env info --path)/bin/activate
- name: Lint with flake8
run: |
source $(poetry env info --path)/bin/activate
# 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: Test
run: |
source $(poetry env info --path)/bin/activate
make test
# pip install pytest pytest-cov
# pytest . --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
- name: Run
run: |
source $(poetry env info --path)/bin/activate
make run
# - name: Run tests
# run: |
# make test
# https://github.com/actions/setup-python/blob/v4/docs/advanced-usage.md#caching-packages
# doc: poetry-config https://python-poetry.org/docs/configuration/