-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.45 KB
/
code_standards.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
name: Code Standards
on:
push: # Comment this line to trigger action only on pull-requests (not recommended if you don't pay for GH Actions)
paths:
- "**.py"
branches: [master]
pull_request:
branches:
- master
- dev
paths:
- "**.py"
workflow_dispatch:
jobs:
code_styling:
name: Code Styling
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install
- name: Run Black
run: black compiler --check
- name: Run iSort
run: isort compiler --check
- name: Run MyPy
run: mypy compiler --show-error-codes
- name: Run PyLint
run: pylint compiler
tests:
name: Run Pytest Tests
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install Dependencies
run: |
pip install poetry
poetry config virtualenvs.create false
poetry install --no-dev
pip install pytest
- name: Run Tests
run: pytest tests