-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 1.74 KB
/
ci.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
60
61
62
63
64
name: Python code quality and tests
on:
push:
branches:
- main
pull_request:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
env:
DEFAULT_PYTHON: "3.11"
PROJECT_PATH: "vm_clockify"
jobs:
code-quality:
name: Check code quality
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Checkout repository
uses: "actions/checkout@v4"
# https://github.com/actions/setup-python
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "pip"
cache-dependency-path: "requirements*"
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Following steps cannot run by pre-commit.ci as repo = local
- name: Run mypy
run: mypy ${{ env.PROJECT_PATH }}/
- name: Pylint review
run: pylint ${{ env.PROJECT_PATH }}/
tests:
runs-on: ubuntu-latest
name: Run tests
steps:
# https://github.com/actions/checkout
- name: Checkout repository
uses: "actions/checkout@v4"
# https://github.com/actions/setup-python
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "pip"
cache-dependency-path: "requirements*"
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run pytest
run: pytest --cov=./ --cov-report=xml