-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.16 KB
/
Copy pathpython-app.yml
File metadata and controls
39 lines (32 loc) · 1.16 KB
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
name: Python CI
on:
push:
branches: [ "develop", "main" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Installa il tuo progetto usando il pyproject.toml
pip install .
# Se hai anche un requirements.txt, scommenta la riga sotto
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
pip install flake8
flake8 . --count --exclude=legacy,venv,tests/__pycache__ --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --exclude=legacy,venv,tests/__pycache__ --max-complexity=10 --max-line-length=127 --statistics
- name: Run Tests
run: |
# Cerca la cartella tests, se non c'è salta senza errore
if [ -d "tests" ]; then pip install pytest && pytest; else echo "No tests folder found, skipping."; fi