-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.23 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
name: CI
on:
push:
branches:
- main
- dev
pull_request:
workflow_dispatch:
env:
UV_CACHE_DIR: /tmp/.uv-cache
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/astral-sh/setup-uv
- name: 🏗 Install uv and Python
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
cache-local-path: ${{ env.UV_CACHE_DIR }}
python-version: "3.13"
- name: 🏗 Install the project
run: uv sync --locked --dev
- name: Run mypy
run: uv run --frozen mypy ${{ env.PROJECT_PATH }}/
- name: Pylint review
run: uv run --frozen pylint ${{ env.PROJECT_PATH }}/
# tests:
# name: Run tests
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version:
# - "3.12"
# - "3.13"
# steps:
# # https://github.com/actions/checkout
# - name: ⤵️ Checkout repository
# uses: actions/checkout@v4
# # https://github.com/astral-sh/setup-uv
# - name: 🏗 Install uv and Python ${{ matrix.python-version }}
# uses: astral-sh/setup-uv@v4
# with:
# enable-cache: true
# cache-dependency-glob: "uv.lock"
# cache-local-path: ${{ env.UV_CACHE_DIR }}
# python-version: ${{ matrix.python-version }}
# - name: 🏗 Install the project
# run: uv sync --locked --dev
# - name: Run pytest
# run: uv run --frozen pytest tests --cov=./ --cov-report=xml --junitxml=pytest-report.xml
# # https://github.com/actions/upload-artifact
# - name: Upload test report
# uses: actions/upload-artifact@v4
# with:
# name: pytest-report-${{ matrix.python-version }}
# path: pytest-report.xml
# # # https://github.com/codecov/codecov-action
# # - name: Upload coverage to Codecov
# # uses: codecov/codecov-action@v5
# # with:
# # token: ${{ secrets.CODECOV_TOKEN }}
# # fail_ci_if_error: true