-
Notifications
You must be signed in to change notification settings - Fork 200
46 lines (39 loc) · 1.31 KB
/
lint.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
name: Linting and code formatting
on: []
# Trigger the workflow on push or pull request,
# but only for the main branch
# push:
# branches: []
# pull_request:
# branches: []
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8.10
- name: Get cache
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/Python/3.8.10/x64/lib/python3.8/site-packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
# Install packages
- name: Install packages required for installation
run: python -m pip install --upgrade pip setuptools wheel
- name: Install dependencies
run: pip install -r requirements.txt
# Check code
- name: Check formatting with yapf
run: python -m yapf --style=.style.yapf --diff --recursive .
# - name: Lint with flake8
# run: flake8 --config=.flake8 .
# - name: Check type annotations with mypy
# run: mypy --config-file=.mypy.ini .
- name: Test with pytest
run: python -m pytest tests