work work work... #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Quality | |
on: [push, pull_request] | |
jobs: | |
lint: | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.11", "3.12"] | |
poetry-version: ["1.6.1"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get full Python version | |
id: full-python-version | |
run: | | |
echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2 | |
with: | |
poetry-version: ${{ matrix.poetry-version }} | |
- name: Configure Poetry to use local virtualenv | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- name: Cache local virtualenv | |
uses: actions/cache@v3 | |
with: | |
path: ./.venv | |
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ matrix.poetry-version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install project dependencies | |
run: poetry install --with=dev,optional --no-root --no-directory | |
- name: Black | |
run: poetry run poe black | |
- name: Ruff | |
run: poetry run poe ruff |