mirror of
https://github.com/google/benchmark.git
synced 2025-01-14 13:50:13 +08:00
9a0422eb23
The reason for this is that `setuptools-scm` installs a version relative to the last release tag - if no tag is found, the default version is taken to be v0.1.0. This was the case in GitHub Actions, where only the PR branch is checked out. Also unpins build system requirements in the `pyproject.toml`. The sdist build system was changed to `build` from `python setup.py sdist` for forward compatibility - `build` is superior in every way, and the advertised solution by both cibuildwheel and PyPA itself. Bump `actions/setup-python` to v5, `pypa/gh-action-pypi-publish` to v1.8.11, and `docker/setup-qemu-action` to v3.
39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
name: python + Bazel pre-commit checks
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
MYPY_CACHE_DIR: "${{ github.workspace }}/.cache/mypy"
|
|
RUFF_CACHE_DIR: "${{ github.workspace }}/.cache/ruff"
|
|
PRE_COMMIT_HOME: "${{ github.workspace }}/.cache/pre-commit"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.11
|
|
cache: pip
|
|
cache-dependency-path: pyproject.toml
|
|
- name: Install dependencies
|
|
run: python -m pip install ".[dev]"
|
|
- name: Cache pre-commit tools
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
${{ env.MYPY_CACHE_DIR }}
|
|
${{ env.RUFF_CACHE_DIR }}
|
|
${{ env.PRE_COMMIT_HOME }}
|
|
key: ${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}-linter-cache
|
|
- name: Run pre-commit checks
|
|
run: pre-commit run --all-files --verbose --show-diff-on-failure
|