Skip to content

Commit 2ecdf03

Browse files
committed
ci: speed up testing
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 6d4526e commit 2ecdf03

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

.github/workflows/deploy.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
name: deploy
22

33
on:
4+
workflow_dispatch:
5+
pull_request:
46
push:
7+
branches:
8+
- main
59
tags:
610
- v*
711

812
jobs:
9-
deploy:
13+
dist:
1014
runs-on: ubuntu-latest
1115
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
16+
- uses: actions/checkout@v4
17+
- uses: hynek/build-and-inspect-python-package@v2
1418

15-
- name: Set up Python
16-
uses: actions/setup-python@v5
19+
deploy:
20+
runs-on: ubuntu-latest
21+
if: startsWith(github.ref, 'refs/tags/v')
22+
steps:
23+
- uses: actions/download-artifact@v4
1724
with:
18-
python-version: '3.11'
19-
20-
- name: Install dependencies for build
21-
run: pip install --upgrade setuptools build
22-
23-
- name: Build
24-
run: python -m build
25+
name: Packages
26+
path: dist
2527

2628
- name: Publish package
2729
uses: pypa/gh-action-pypi-publish@release/v1
2830
with:
29-
user: __token__
3031
password: ${{ secrets.pypi_password }}

.github/workflows/test.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ jobs:
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939

40+
- uses: astral-sh/setup-uv@v3
41+
4042
- name: Install test dependencies
41-
run: pip install tox tox-gh-actions
43+
run: uv tool install --with tox-gh-actions --with tox-uv tox
4244

4345
- name: Test packaging
4446
run: tox -e pkg
@@ -57,7 +59,12 @@ jobs:
5759

5860
post-test:
5961
name: All tests passed
62+
if: always()
63+
needs: [test]
6064
runs-on: ubuntu-latest
61-
needs: test
65+
timeout-minutes: 2
6266
steps:
63-
- run: echo ok
67+
- name: Decide whether the needed jobs succeeded or failed
68+
uses: re-actors/alls-green@release/v1
69+
with:
70+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)