Skip to content

Commit 500c53c

Browse files
authored
ci: speed up testing (#93)
* ci: speed up testing Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * chore: remove pkg job with faster/better check in CI already * Update .github/workflows/test.yml --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 55b2d6d commit 500c53c

File tree

3 files changed

+24
-34
lines changed

3 files changed

+24
-34
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 & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ jobs:
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939

40-
- name: Install test dependencies
41-
run: pip install tox tox-gh-actions
40+
- uses: astral-sh/setup-uv@v3
4241

43-
- name: Test packaging
44-
run: tox -e pkg
42+
- name: Install tox
43+
run: uv tool install --with tox-gh-actions --with tox-uv tox
4544

4645
- name: Run tests with PyTest 6
4746
run: tox
@@ -57,7 +56,12 @@ jobs:
5756

5857
post-test:
5958
name: All tests passed
59+
if: always()
60+
needs: [test]
6061
runs-on: ubuntu-latest
61-
needs: test
62+
timeout-minutes: 2
6263
steps:
63-
- run: echo ok
64+
- name: Decide whether the needed jobs succeeded or failed
65+
uses: re-actors/alls-green@release/v1
66+
with:
67+
jobs: ${{ toJSON(needs) }}

tox.ini

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[tox]
22
envlist =
33
py{38,39,310,311,312}-pytest{6,7,8}
4-
pkg
54

65
[gh-actions]
76
python =
@@ -25,17 +24,3 @@ deps =
2524
pytest8: pytest>=8.0.0,<9.0.0
2625

2726
commands = {envpython} -m pytest {posargs}
28-
29-
[testenv:pkg]
30-
skip_install = true
31-
deps =
32-
twine
33-
build
34-
commands =
35-
{envpython} -c 'import os.path, shutil, sys; \
36-
dist_dir = os.path.join("{toxinidir}", "dist"); \
37-
os.path.isdir(dist_dir) or sys.exit(0); \
38-
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
39-
shutil.rmtree(dist_dir)'
40-
{envpython} -m build --outdir {toxinidir}/dist/ {toxinidir}
41-
{envpython} -m twine check --strict dist/*

0 commit comments

Comments
 (0)