Skip to content

Commit bbe2fa6

Browse files
committed
Add linting to CI.
1 parent 1e69092 commit bbe2fa6

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: API Lint
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- uses: actions/setup-python@v2
12+
name: Install Python
13+
with:
14+
python-version: '3.9'
15+
16+
- name: Pip cache
17+
id: pip-cache
18+
uses: actions/cache@v2
19+
with:
20+
path: ${{ env.pythonLocation }}
21+
key: api-lint-${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements-dev.txt') }}
22+
23+
- name: Install deps
24+
if: steps.pip-cache.outputs.cache-hit != 'true'
25+
run: |
26+
cd api
27+
python -m pip install --upgrade pip
28+
python -m pip install -r requirements.txt
29+
python -m pip install -r requirements-dev.txt
30+
31+
- name: Run linting
32+
run: |
33+
sh ./scripts/lint.sh

scripts/lint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
mypy .
6+
7+
ruff check .
8+
ruff format --check .

0 commit comments

Comments
 (0)