Skip to content

Commit 3a3e8ce

Browse files
committed
test: refactor CI
per request from #1432 (comment) closes #1366 ### Changes - remove all test jobs from test.yml workflow except the one that runs on s390x platform. - rename the test.yml Display name accordingly: "Tests (s390x)" - skip building ppc64le wheels when not triggered on master branch. - reconfigure wheels.yml workflow triggers. The wheels.yml CI now runs for 1. any push to master branch 2. any change in a PR that targets master branch (excluding when PR changes only affect docs/ path) 3. any tag (starting with "v") is pushed - added `skip-existing` param in case deployment to PyPI suffers a network error and the CI just needs to be re-run. - cherry pick changes from PR #1366 (about CI triggers for lint and spell-check CI workflows) - auto-cancel wheels CI if new run triggered on non-default branch - added step to job that deploys wheels to PyPI. This new step creates a GitHub Release for the tag that was pushed.
1 parent d16e2f3 commit 3a3e8ce

File tree

4 files changed

+32
-49
lines changed

4 files changed

+32
-49
lines changed

.github/workflows/codespell.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ name: Codespell
44

55
on:
66
pull_request:
7+
branches: [master]
78
push:
9+
branches: [master]
810

911
permissions:
1012
contents: read

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ name: Lints
22

33
on:
44
pull_request:
5+
branches: [master]
56
push:
7+
branches: [master]
68
paths-ignore:
79
- '**.rst'
810

.github/workflows/tests.yml

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,14 @@
1-
name: Tests
1+
name: Tests (s390x)
22

33
on:
44
pull_request:
5+
branches: [master]
56
push:
7+
branches: [master]
68
paths-ignore:
79
- '**.rst'
810

911
jobs:
10-
linux:
11-
runs-on: ${{ matrix.os }}
12-
strategy:
13-
matrix:
14-
include:
15-
- os: ubuntu-24.04
16-
python-version: '3.10'
17-
- os: ubuntu-24.04
18-
python-version: '3.13'
19-
- os: ubuntu-24.04
20-
python-version: 'pypy3.10'
21-
- os: ubuntu-24.04-arm
22-
python-version: '3.13'
23-
24-
steps:
25-
- name: Checkout pygit2
26-
uses: actions/checkout@v5
27-
28-
- name: Set up Python
29-
uses: actions/setup-python@v6
30-
with:
31-
python-version: ${{ matrix.python-version }}
32-
33-
- name: Linux
34-
run: |
35-
sudo apt install tinyproxy
36-
LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.1 /bin/sh build.sh test
37-
3812
linux-s390x:
3913
runs-on: ubuntu-24.04
4014
if: github.ref == 'refs/heads/master'
@@ -53,19 +27,3 @@ jobs:
5327
run: |
5428
LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.1 /bin/sh build.sh test
5529
continue-on-error: true # Tests are expected to fail, see issue #812
56-
57-
macos-arm64:
58-
runs-on: macos-latest
59-
steps:
60-
- name: Checkout pygit2
61-
uses: actions/checkout@v5
62-
63-
- name: Set up Python
64-
uses: actions/setup-python@v6
65-
with:
66-
python-version: '3.13'
67-
68-
- name: macOS
69-
run: |
70-
export OPENSSL_PREFIX=`brew --prefix openssl@3`
71-
LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.1 /bin/sh build.sh test

.github/workflows/wheels.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
name: Wheels
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: ${{ github.ref_name != 'master' }}
6+
37
on:
48
push:
5-
branches:
6-
- master
7-
- wheels-*
9+
branches: [master]
810
tags:
9-
- 'v*'
11+
- 'v*'
12+
pull_request:
13+
branches: [master]
14+
paths-ignore:
15+
- 'docs/**'
1016

1117
jobs:
1218
build_wheels:
@@ -54,6 +60,7 @@ jobs:
5460

5561
build_wheels_ppc:
5662
name: Wheels for linux-ppc
63+
if: github.ref == 'refs/heads/master'
5764
runs-on: ubuntu-24.04
5865

5966
steps:
@@ -140,3 +147,17 @@ jobs:
140147
with:
141148
user: __token__
142149
password: ${{ secrets.PYPI_API_TOKEN }}
150+
skip-existing: true
151+
152+
- name: Create GitHub Release
153+
env:
154+
GITHUB_TOKEN: ${{ github.token }}
155+
TAG: ${{ github.ref_name }}
156+
REPO: ${{ github.repository }}
157+
# https://cli.github.com/manual/gh_release_create
158+
run: >-
159+
gh release create ${TAG}
160+
--verify-tag
161+
--repo ${REPO}
162+
--title ${TAG}
163+
--generate-notes

0 commit comments

Comments
 (0)