Skip to content

Commit bf76f48

Browse files
authored
CI: review triggers for wheel and tests (#70)
1 parent be3f3be commit bf76f48

3 files changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/cibuildwheel.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ name: Build
22

33
on:
44
push:
5-
tags:
6-
# ytf did they invent their own syntax that's almost regex?
7-
# ** matches 'zero or more of any character'
8-
- 'release-v[0-9]+.[0-9]+.[0-9]+**'
9-
- 'prerelease-v[0-9]+.[0-9]+.[0-9]+**'
5+
branches: [main]
6+
pull_request:
7+
branches: ["*"]
8+
workflow_dispatch: # allows you to trigger manually
9+
1010
jobs:
1111
build_wheels:
1212
uses: explosion/gha-cibuildwheel/.github/workflows/cibuildwheel.yml@main
1313
permissions:
1414
contents: write
1515
actions: read
1616
with:
17+
wheel-name-pattern: "confection-*.whl"
1718
pure-python: true
19+
create-release: ${{ startsWith(github.ref, 'refs/tags/release-') || startsWith(github.ref, 'refs/tags/prerelease-') }}
1820
secrets:
1921
gh-token: ${{ secrets.GITHUB_TOKEN }}
20-

.github/workflows/publish_pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# The cibuildwheel action triggers on creation of a release, this
2-
# triggers on publication.
1+
# The cibuildwheel action triggers on all pushes and PRs;
2+
# this action triggers on release publication.
33
# The expected workflow is to create a draft release and let the wheels
44
# upload, and then hit 'publish', which uploads to PyPi.
55

.github/workflows/tests.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,27 @@ name: tests
22

33
on:
44
push:
5+
branches: [main]
56
pull_request:
6-
types: [opened, synchronize, reopened, edited]
7+
branches: ["*"]
8+
workflow_dispatch: # allows you to trigger manually
9+
10+
# When this workflow is queued, automatically cancel any previous running
11+
# or pending jobs from the same branch
12+
concurrency:
13+
group: tests-${{ github.ref }}
14+
cancel-in-progress: true
715

816
jobs:
917
validate:
1018
name: Validate
11-
if: github.repository_owner == 'explosion'
1219
runs-on: ubuntu-latest
1320
steps:
1421
- name: Check out repo
15-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
1623

1724
- name: Configure Python version
18-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
1926
with:
2027
python-version: "3.10"
2128

@@ -33,8 +40,6 @@ jobs:
3340
python -m flake8 confection --count --select=E901,E999,F821,F822,F823,W605 --show-source --statistics
3441
tests:
3542
name: Test
36-
needs: Validate
37-
if: github.repository == 'explosion/confection'
3843
strategy:
3944
fail-fast: false
4045
matrix:
@@ -45,10 +50,10 @@ jobs:
4550

4651
steps:
4752
- name: Check out repo
48-
uses: actions/checkout@v4
53+
uses: actions/checkout@v6
4954

5055
- name: Configure Python version
51-
uses: actions/setup-python@v5
56+
uses: actions/setup-python@v6
5257
with:
5358
python-version: ${{ matrix.python_version }}
5459

0 commit comments

Comments
 (0)