Skip to content

Commit 4d57cf6

Browse files
committed
CI: Update CI workflows.
Perform full CI test and build suite on pushes to `main` branch only. Run short CI test suite on pushes to non-main branches. This is intended to avoid unexpected CI failures on pushing tags.
1 parent 8681cd4 commit 4d57cf6

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

.github/workflows/ci-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
publish-pypi:
3939
name: Publish to pypi
4040
uses: ./.github/workflows/publish.yaml
41-
needs: tests
41+
needs: publish-test
4242
with:
4343
pypi: upload.pypi
4444
permissions:
@@ -47,7 +47,7 @@ jobs:
4747
github-release:
4848
name: Create GitHub release
4949
uses: glenn20/python-ci/.github/workflows/release.yaml@v1
50-
needs: tests
50+
needs: publish-pypi
5151
permissions:
5252
contents: write # IMPORTANT: mandatory for github release
5353
id-token: write # IMPORTANT: mandatory for github release

.github/workflows/ci-tests.yaml renamed to .github/workflows/ci-test-build.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,20 @@ name: Test and Build
99

1010
on:
1111
push:
12-
branches: [main, dev]
12+
branches: [main]
1313
workflow_dispatch:
1414

1515
jobs:
1616
tests:
17-
name: CI tests
18-
uses: glenn20/python-ci/.github/workflows/check-test-build.yaml@v1
19-
with: # A short test matrix for fast testing of commits
20-
os: '["ubuntu-latest"]'
21-
python-version: '["3.9", "3.13"]'
17+
name: CI tests (full)
18+
uses: glenn20/python-ci/.github/workflows/check-test-build.yaml@main
19+
with:
20+
os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
21+
python-version: '["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]'
2222

2323
publish-test:
2424
name: Publish to test.pypi
2525
needs: tests
26-
if: |
27-
github.event_name == 'workflow_dispatch' ||
28-
(github.event_name == 'push' && github.ref == 'refs/heads/main')
2926
uses: ./.github/workflows/publish.yaml
3027
with:
3128
pypi: test.pypi

.github/workflows/ci-test.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI Tests (short)
2+
3+
# Run the short code checks and CI pytest workflow on
4+
# - push to non main (eg. )`dev`) branches, or
5+
# - manually triggered from github Actions tab.
6+
7+
on:
8+
push:
9+
branches-ignore: [main]
10+
workflow_dispatch:
11+
12+
jobs:
13+
tests:
14+
name: CI tests
15+
uses: glenn20/python-ci/.github/workflows/check-test-build.yaml@v1
16+
with: # A short test matrix for fast testing of commits
17+
os: '["ubuntu-latest"]'
18+
python-version: '["3.9", "3.13"]'

0 commit comments

Comments
 (0)