Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build/test with multiple Python versions #40

Merged
merged 8 commits into from
Sep 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 40 additions & 11 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & test
name: Test & release

on:
push:
Expand All @@ -16,10 +16,18 @@ on:
workflow_dispatch:

jobs:
build:
name: Build & verify package
check:
name: Check
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -29,9 +37,8 @@ jobs:
with:
enable-cache: true

- name: Configure version
if: github.event.action == 'published'
run: ./.github/set-version
- name: Install Python
run: uv python install ${{ matrix.python-version }}

- name: Test
run: make test
Expand All @@ -45,21 +52,43 @@ jobs:
- name: format
run: uv run ruff format --diff

# Just test the build works, we'll upload the one in the next job
# instead, if needed.
- name: Build
run: make build

- name: Upload package
build:
name: Build package
needs: check
if: github.event.action == 'published'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Configure version
if: github.event.action == 'published'
run: ./.github/set-version

- name: Build
run: make build

- name: Upload package
uses: actions/upload-artifact@v4
with:
name: Packages
path: dist/*

release:
name: Publish
runs-on: ubuntu-latest
if: github.event.action == 'published'
publish:
name: Publish package
needs: build
runs-on: ubuntu-latest
environment: pypi-release

permissions:
Expand Down