| 1 |
name: main |
| 2 |
on: [push, pull_request, release] |
| 3 |
jobs: |
| 4 |
test: |
| 5 |
runs-on: ${{ matrix.os }} |
| 6 |
strategy: |
| 7 |
matrix: |
| 8 |
os: |
| 9 |
- "ubuntu-latest" |
| 10 |
- "macos-latest" |
| 11 |
# - "windows-latest" |
| 12 |
python-version: |
| 13 |
- "3.9" |
| 14 |
- "3.10" |
| 15 |
- "3.11" |
| 16 |
- "3.12" |
| 17 |
- "3.13" |
| 18 |
steps: |
| 19 |
- uses: actions/checkout@v4 |
| 20 |
- name: Set up Python ${{ matrix.python-version }} |
| 21 |
uses: astral-sh/setup-uv@v5 |
| 22 |
with: |
| 23 |
version: "0.6.9" |
| 24 |
python-version: ${{ matrix.python-version }} |
| 25 |
enable-cache: true |
| 26 |
cache-dependency-glob: "uv.lock" |
| 27 |
- name: Install graphviz |
| 28 |
run: sudo apt install -y graphviz || true |
| 29 |
- name: Run all |
| 30 |
run: make all |
| 31 |
- name: Upload coverage data to coveralls.io |
| 32 |
run: uv run --frozen -- coveralls --service=github |
| 33 |
env: |
| 34 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 |
COVERALLS_FLAG_NAME: ${{ matrix.test-name }} |
| 36 |
COVERALLS_PARALLEL: true |
| 37 |
|
| 38 |
coveralls: |
| 39 |
name: Indicate completion to coveralls.io |
| 40 |
needs: test |
| 41 |
runs-on: ubuntu-latest |
| 42 |
steps: |
| 43 |
- uses: actions/checkout@v4 |
| 44 |
- name: Set up Python ${{ matrix.python-version }} |
| 45 |
uses: astral-sh/setup-uv@v5 |
| 46 |
with: |
| 47 |
version: "0.6.9" |
| 48 |
python-version: ${{ matrix.python-version }} |
| 49 |
enable-cache: true |
| 50 |
cache-dependency-glob: "uv.lock" |
| 51 |
- name: Upload coverage data to coveralls.io |
| 52 |
run: uv run --frozen -- coveralls --service=github --finish |
| 53 |
env: |
| 54 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 55 |
|
| 56 |
publish: |
| 57 |
if: github.event_name == 'push' && github.ref_type == 'tag' |
| 58 |
needs: coveralls |
| 59 |
name: upload release to PyPI |
| 60 |
runs-on: ubuntu-latest |
| 61 |
permissions: |
| 62 |
id-token: write |
| 63 |
steps: |
| 64 |
- uses: actions/checkout@v4 |
| 65 |
- uses: pdm-project/setup-pdm@v4 |
| 66 |
- name: Publish package distributions to PyPI |
| 67 |
run: pdm publish |