1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
name: CI
on:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
defaults:
run:
shell: bash
env:
FORCE_COLOR: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build & verify package
runs-on: ubuntu-latest
permissions:
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
with:
attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
tox:
name: Tests on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
steps:
- uses: astral-sh/setup-uv@v6
- name: Download packages
uses: actions/download-artifact@v4
with:
name: Packages
path: dist/
- run: tar xf dist/*.tar.gz --strip-components=1
- run: uv sync
- name: Install tox
run: |
uv tool install -p 3.13 --with=tox-uv tox
- name: Show tox config
run: tox c
- name: Run tox
run: tox -v --exit-and-dump-after 60 --parallel-no-spinner --installpkg dist/*.whl
- uses: codecov/codecov-action@v5
if: ${{ always() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish:
runs-on: ubuntu-latest
environment: "Package deployment"
needs: [tox]
permissions:
attestations: write
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
name: Packages
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
|