-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (100 loc) · 3.04 KB
/
ci.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: neoconfigen CI
on:
pull_request:
branches:
- main
jobs:
lint_with_flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install flake8
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with pylint
run: |
flake8 configen
format_with_black_and_isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black isort
- name: Format with black
run: |
python -m black --check configen
- name: Format with isort
run: |
isort . --check --diff
check_yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install pydocstyle
run: |
python -m pip install --upgrade pip
pip install yamllint
- name: Check docstrings with pydocstyle
run: |
yamllint .
run_tests_and_type_checking:
needs: [format_with_black_and_isort, lint_with_flake8, check_yaml]
runs-on: ubuntu-latest
steps:
# ----------------------------------------------
# ---- check-out repo and set-up python ----
# ----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
# ----------------------------------------------
# ----- install & configure poetry -----
# ----------------------------------------------
- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# ----------------------------------------------
# install dependencies if cache does not exist
# ----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
# ----------------------------------------------
# ----- install and run pyright -----
# ----------------------------------------------
- name: Setup node.js (for pyright)
uses: actions/setup-node@v1
with:
node-version: "14"
- name: Install pyright
run: npm install -g pyright
- name: Run type checking
run: |
poetry run pyright configen
# ----------------------------------------------
# ----- Run Tests -----
# ----------------------------------------------
- name: Test with pytest
run: |
poetry run python -m pytest -vv tests/