Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
name: CI

on: [push, pull_request]
on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
Expand All @@ -10,31 +20,29 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'

- name: Install deps and venv
- name: Install dependencies
run: |
sudo ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime
echo Europe/Rome | sudo tee /etc/timezone
sudo apt update && sudo apt install -y python3-pip python3-dev
python3 -m pip install virtualenv autopep8 packaging
virtualenv /tmp/ci_venv
/tmp/ci_venv/bin/pip install ".[full]" --extra-index-url https://download.pytorch.org/whl/cpu
/tmp/ci_venv/bin/pip install flake8 pylint pytest
python -m pip install --upgrade pip
pip install ".[full]" --extra-index-url https://download.pytorch.org/whl/cpu
pip install flake8 pylint pytest

- name: Run flake8
run: |
/tmp/ci_venv/bin/flake8 . \
flake8 . \
--max-line-length=300 \
--ignore=E701,W503,W504 \
--exclude=__init__.py,__pycache__,.venv,.env,build

- name: Run pylint
run: |
find . -type f -name '*.py' \
-not -path "*/.env/*" \
-not -path "*/__pycache__/*" \
-not -path "*/.ipynb_checkpoints/*" \
-not -path "*/tests/*" -not -path "*/examples/*" \
-print0 | xargs -0 /tmp/ci_venv/bin/pylint --rcfile=.pylintrc -E
-print0 | xargs -0 pylint --rcfile=.pylintrc -E

- name: Run pytest
run: |
/tmp/ci_venv/bin/python -m pytest tests/
run: pytest tests/
Loading