generated from doramasma/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 922 Bytes
/
main.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
name: Lint and Type Check
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint_and_type_check:
runs-on: ubuntu-latest
steps:
# Checkout the repository code
- name: Checkout code
uses: actions/checkout@v3
# Set up Python
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Install dependencies using uv
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
# Sync the virtual environment and install project dependencies
- name: Sync virtual environment
run: uv sync
# Run ruff for linting
- name: Run ruff
run: uv run ruff check .
# Run mypy for type checking
- name: Run mypy
run: uv run mypy --strict .