36 lines
No EOL
949 B
YAML
36 lines
No EOL
949 B
YAML
name: lint
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: install python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.12'
|
|
- name: set up poetry
|
|
uses: abatilo/actions-poetry@v2
|
|
with:
|
|
poetry-version: '1.8.2'
|
|
- name: set up virtual environment
|
|
run: |
|
|
poetry config virtualenvs.create true --local
|
|
poetry config virtualenvs.in-project true --local
|
|
- name: cache virtual environment
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ./.venv
|
|
key: venv-${{ hashFiles('poetry.lock') }}
|
|
- name: install dependencies
|
|
run: poetry install --with dev
|
|
- name: check linter and formatter
|
|
run: |
|
|
poetry run ruff check .
|
|
poetry run ruff format --check . |