Speed up and simplify github workflows (#1128)

- Enable parallel tests in the CI with pytest-xdist
- Migrate to the official `astral-sh/setup-uv` github action
- Call `pre-commit` run as a single job in CI instead of relisting each
check
- Use `uv` version 0.4.16
- Fix bug with pre-commit cache
- Update `publish.yml` to use  `astral-sh/setup-uv`
This commit is contained in:
Steven B.
2024-09-27 10:27:53 +01:00
committed by GitHub
parent 1ab08f454f
commit 038b6993ca
8 changed files with 67 additions and 87 deletions

View File

@@ -4,7 +4,8 @@ on:
types: [published]
env:
UV_VERSION: 0.4.5
UV_VERSION: 0.4.16
PYTHON_VERSION: 3.12
jobs:
build-n-publish:
@@ -14,16 +15,19 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@master
- name: Checkout source files
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
run: |-
pipx install uv==${{ env.UV_VERSION }} --python "${{ steps.setup-python.outputs.python-path }}"
- name: Build a binary wheel and a source tarball
run: uv build
- name: Publish release on pypi
uses: pypa/gh-action-pypi-publish@release/v1