Skip to content

Commit d6046d9

Browse files
committed
Add github workflow definitions
1 parent 3a33422 commit d6046d9

File tree

4 files changed

+87
-0
lines changed

4 files changed

+87
-0
lines changed

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
min_python_version = 3.8.1

.github/workflows/lint.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Code Style
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: "Lint Code Base"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Set up Python 3.8
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install poetry==1.1.12
22+
BLACK_VERSION=$(poetry show black | grep version | rev | cut -d " " -f 1 | rev)
23+
FLAKE8_VERSION=$(poetry show flake8 | grep version | rev | cut -d " " -f 1 | rev)
24+
pip install "black==${BLACK_VERSION}" "flake8==${FLAKE8_VERSION}"
25+
26+
- name: Lint with flake8
27+
run: |
28+
# stop the build if there are Python syntax errors or undefined names
29+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
30+
flake8 . --count --max-complexity=10 --max-line-length=88 --statistics
31+
32+
- name: Check with black
33+
run: |
34+
black . --check --diff
35+
36+
- name: Run GitHub super-linter
37+
uses: github/super-linter:slim-v4
38+
env:
39+
VALIDATE_ALL_CODEBASE: true
40+
VALIDATE_YAML: true
41+
VALIDATE_JSON: true
42+
VALIDATE_MD: true
43+
VALIDATE_BASH: true
44+
VALIDATE_DOCKER: true
45+
VALIDATE_GO: true
46+
VALIDATE_ENV: true

.github/workflows/type-check.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Type Check
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: "Type Check Code Base"
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: "Set up Python 3.8"
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.8
17+
18+
- name: "Install Dependencies"
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install poetry
22+
poetry config virtualenvs.create false
23+
poetry install --no-interaction --no-dev
24+
25+
- name: "Set up Node.js"
26+
uses: actions/setup-node@v1
27+
with:
28+
node-version: "14.x"
29+
30+
- name: "Install Pyright"
31+
run: |
32+
npm install -g pyright
33+
34+
- name: "Type Check with Pyright"
35+
run: |
36+
pyright .

pyrightconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"exclude": ["venv/**"]
3+
}

0 commit comments

Comments
 (0)