Skip to content

Commit 6ecc692

Browse files
committed
refactor: combined testing with release workflow
1 parent ea67572 commit 6ecc692

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

.github/workflows/release.yaml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,55 @@
1-
name: Release
1+
name: Test and Publish Release
22

33
on:
4-
workflow_run:
5-
workflows: ["Test On All Platforms"]
6-
types:
7-
- completed
4+
push:
5+
branches:
6+
- testing
7+
tags:
8+
- 'v*-test'
9+
- 'v[0-9]+.[0-9]+.[0-9]+'
810
workflow_dispatch:
911

1012
permissions:
11-
id-token: write
1213
contents: read
14+
id-token: write
1315

1416
jobs:
17+
test:
18+
name: Test on Linux/MacOS/Window
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-latest, macos-latest, windows-latest]
24+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Install uv and set Python version.
30+
uses: astral-sh/setup-uv@v5
31+
with:
32+
version: "0.7.5"
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Install libusb on Linux.
36+
if: runner.os == 'Linux'
37+
run: |
38+
sudo apt-get update
39+
sudo apt-get install -y libusb-1.0-0-dev libudev-dev
40+
41+
- name: Run tests - ${{ matrix.python-version }} - ${{ matrix.os }}
42+
run: |
43+
uv run --all-extras pytest
44+
1545
publish:
16-
name: Build and Publish
46+
name: Build & Publish
47+
needs: test
1748
if: |
18-
github.event.workflow_run.conclusion == 'success' &&
19-
startsWith(github.event.workflow_run.head_branch, 'refs/tags/v') &&
20-
!endsWith(github.event.workflow_run.head_branch, '-test')
49+
github.ref_type == 'tag' &&
50+
startsWith(github.ref, 'refs/tags/v') &&
51+
!endsWith(github.ref, '-test') &&
52+
success()
2153
runs-on: ubuntu-latest
2254
environment:
2355
name: pypi

0 commit comments

Comments
 (0)