Skip to content

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.0… #611

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.0…

chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.0… #611

Workflow file for this run

---
name: build
defaults:
run:
shell: bash
env:
POETRY_HOME: ~/.poetry
POETRY_VERSION: '1.5.1'
POETRY_VIRTUALENVS_IN_PROJECT: true
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@v3
with:
path: ${{ env.POETRY_HOME }}
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: curl -sSL https://install.python-poetry.org | python
- name: Prepend Poetry to PATH
run: echo ${{ env.POETRY_HOME }}/bin >> "$GITHUB_PATH"
- name: Cache venv
id: cache-venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --sync -v
- name: Install root package
run: poetry install --no-interaction --only-root -v
- name: Cache pre-commit hooks
id: cache-pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
pre-commit-${{ runner.os }}-
- name: Prune pre-commit hooks
if: steps.cache-pre-commit.outputs.cache-hit != 'true'
run: poetry run pre-commit gc
- name: Run gitlint
run: poetry run pre-commit run --color=always --hook-stage manual gitlint-ci
- name: Run pre-commit
run: poetry run pre-commit run --all-files --color=always --show-diff-on-failure
pytest:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@v3
with:
path: ${{ env.POETRY_HOME }}
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ env.POETRY_VERSION }}
- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: curl -sSL https://install.python-poetry.org | python
- name: Prepend Poetry to PATH
run: echo ${{ env.POETRY_HOME }}/bin >> "$GITHUB_PATH"
- name: Cache venv
id: cache-venv
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --sync -v
- name: Install root package
run: poetry install --no-interaction --only-root -v
- name: Run pytest
run: poetry run pytest --color=yes --cov-config=pyproject.toml --with-functional
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.4
- name: Run SonarCloud scanner
uses: SonarSource/sonarcloud-github-action@v1.9
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
release:
if: github.ref == 'refs/heads/master'
needs: [pre-commit, pytest]
runs-on: ubuntu-latest
concurrency: release
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run Python Semantic Release
uses: relekang/python-semantic-release@v8.0.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pypi_token: ${{ secrets.PYPI_TOKEN }}