Skip to content

chore(deps): update crazy-max/ghaction-import-gpg action to v6.2.0 #1342

chore(deps): update crazy-max/ghaction-import-gpg action to v6.2.0

chore(deps): update crazy-max/ghaction-import-gpg action to v6.2.0 #1342

Workflow file for this run

---
name: build
defaults:
run:
shell: bash
env:
POETRY_HOME: ~/.poetry
# renovate: datasource=github-tags depName=python-poetry/poetry
POETRY_VERSION: '1.8.4'
POETRY_VIRTUALENVS_IN_PROJECT: true
on: [push, pull_request]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 2
- name: Identify Python version
run: echo "PYTHON_VERSION=$(python -V | cut -d' ' -f2)" >> "$GITHUB_ENV"
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ${{ env.POETRY_HOME }}
key: poetry-${{ runner.os }}-${{ env.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@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}
restore-keys: venv-${{ runner.os }}-${{ env.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@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-${{ runner.os }}-${{ env.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: Cache mypy
id: cache-mypy
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: .mypy_cache
key: mypy-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}-${{ github.sha }}
restore-keys: mypy-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}-
- 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.9", "3.10", "3.11", "3.12", "3.13"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Set up Python
id: setup-python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
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@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
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 --numprocesses=8 --with-functional
- name: Upload coverage report
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Run SonarCloud scanner
uses: SonarSource/sonarcloud-github-action@383f7e52eae3ab0510c3cb0e7d9d150bbaeab838 # v3.1.0
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
release:
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
needs: [pre-commit, pytest]
runs-on: ubuntu-latest
concurrency: release
permissions:
contents: write
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Identify Python version
run: echo "PYTHON_VERSION=$(python -V | cut -d' ' -f2)" >> "$GITHUB_ENV"
- name: Cache Poetry
id: cache-poetry
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: ${{ env.POETRY_HOME }}
key: poetry-${{ runner.os }}-${{ env.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@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('poetry.lock') }}
restore-keys: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --sync -v
- name: Set up Git signing
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
with:
gpg_private_key: ${{ secrets.GPG_SIGN_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
- name: Bump version
id: bump-version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run semantic-release version
- name: Publish package distributions to GitHub Releases
if: steps.bump-version.outputs.released == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run semantic-release publish
- name: Publish package distributions to PyPI
if: steps.bump-version.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@f7600683efdcb7656dec5b29656edb7bc586e597 # v1.10.3