-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (34 loc) · 1.01 KB
/
lint_and_test.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
# Workflow is triggered on push and pull_request events.
#
# Docs:
# - GitHub Actions: https://help.github.com/en/actions
#
name: Linting & Test
on:
# Trigger the workflow on pushes to only the 'main' branch (this avoids duplicate checks being run e.g. for dependabot pull requests)
push:
branches: [ main ]
# Trigger the workflow on any pull request
pull_request:
jobs:
linting-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Lint - isort
run: isort main.py trivia_box.py test/
- name: Lint - mypy
run: mypy main.py trivia_box.py test/
- name: Lint - flake8
run: flake8 main.py trivia_box.py test/
- name: Lint - blue
run: blue --check main.py trivia_box.py test/
- name: Test
run: pytest