Skip to content

Commit 3b52f4f

Browse files
authored
Backport PR #3772 on branch 1.11.x (ci: Check PRs for semantic labels) (#3773)
1 parent 2ca01c5 commit 3b52f4f

7 files changed

Lines changed: 42 additions & 40 deletions

File tree

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
- package-ecosystem: pip
8+
directory: /
9+
schedule:
10+
interval: weekly

.github/workflows/benchmark.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ on:
99
env:
1010
FORCE_COLOR: "1"
1111

12-
defaults:
13-
run:
14-
shell: bash -e {0} # -e to fail on error
15-
1612
jobs:
1713
benchmark:
1814
runs-on: ${{ matrix.os }}
@@ -29,9 +25,10 @@ jobs:
2925
ASV_DIR: "./benchmarks"
3026

3127
steps:
32-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v5
3329
with:
3430
fetch-depth: 0
31+
# no blob:none so ASV can compare commits
3532

3633
- name: Fetch main branch for `asv run`’s hash
3734
run: git fetch origin main:main

.github/workflows/check-pr.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ on:
1818
# code change (e.g. this workflow)
1919
- synchronize
2020

21-
defaults:
22-
run:
23-
shell: bash -e {0} # -e to fail on error
24-
2521
jobs:
2622
# This job verifies that the milestone is present or not necessary
2723
# and determines if “check-relnotes” needs to be run.
2824
check-milestone:
29-
name: Check Milestone
25+
name: Check title, milestone, and labels
3026
runs-on: ubuntu-latest
3127
steps:
3228
- name: Check if milestone or “no milestone” label is present
@@ -40,6 +36,10 @@ jobs:
4036
text: ${{ github.event.pull_request.body }}
4137
regex: '^\s*- \[x\].*Release notes.*not necessary because:(.*)$'
4238
flags: m
39+
- name: Check PR title
40+
uses: amannn/action-semantic-pull-request@v6
41+
env: # Needs repo options: “Squash and merge” with commit message set to “PR title”
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
outputs:
4444
no-relnotes-reason: ${{ steps.checked-relnotes.outputs.group1 }}
4545
# This job verifies that the relevant release notes file has been modified.

.github/workflows/ci.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,17 @@ env:
1515
# so because leidenalg 0.10.0 has them, we pre-compile things: https://github.com/vtraag/leidenalg/issues/173
1616
UV_COMPILE_BYTECODE: "1"
1717

18-
defaults:
19-
run:
20-
shell: bash -e {0} # -e to fail on error
21-
2218
jobs:
2319
get-environments:
2420
runs-on: ubuntu-latest
2521
outputs:
2622
envs: ${{ steps.get-envs.outputs.envs }}
2723
steps:
28-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v5
2925
with:
3026
filter: blob:none
3127
fetch-depth: 0
32-
- uses: astral-sh/setup-uv@v5
28+
- uses: astral-sh/setup-uv@v6
3329
with:
3430
enable-cache: false
3531
- id: get-envs
@@ -54,12 +50,12 @@ jobs:
5450
env: # environment variable for use in codecov’s env_vars tagging
5551
ENV_NAME: ${{ matrix.env.name }}
5652
steps:
57-
- uses: actions/checkout@v4
53+
- uses: actions/checkout@v5
5854
with:
5955
fetch-depth: 0
6056
filter: blob:none
6157

62-
- uses: astral-sh/setup-uv@v5
58+
- uses: astral-sh/setup-uv@v6
6359
with:
6460
enable-cache: true
6561
python-version: ${{ matrix.env.python }}
@@ -110,16 +106,16 @@ jobs:
110106
build:
111107
runs-on: ubuntu-latest
112108
steps:
113-
- uses: actions/checkout@v4
109+
- uses: actions/checkout@v5
114110
with:
115111
fetch-depth: 0
116112
filter: blob:none
117113
- uses: actions/setup-python@v5
118114
with:
119-
python-version: "3.13"
120-
- uses: astral-sh/setup-uv@v5
115+
python-version: "3.x"
116+
- uses: astral-sh/setup-uv@v6
121117
with:
122-
enable-cache: false
118+
enable-cache: true
123119
- run: uvx --from build pyproject-build --sdist --wheel .
124120
- run: uvx twine check dist/*
125121

@@ -131,6 +127,6 @@ jobs:
131127
- build
132128
runs-on: ubuntu-latest
133129
steps:
134-
- uses: re-actors/alls-green@release/v1
135-
with:
136-
jobs: ${{ toJSON(needs) }}
130+
- uses: re-actors/alls-green@release/v1
131+
with:
132+
jobs: ${{ toJSON(needs) }}

.github/workflows/publish.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,21 @@ on:
77
env:
88
FORCE_COLOR: "1"
99

10-
defaults:
11-
run:
12-
shell: bash -e {0} # -e to fail on error
13-
1410
jobs:
1511
publish:
1612
runs-on: ubuntu-latest
1713
environment: pypi
1814
permissions:
1915
id-token: write # to authenticate as Trusted Publisher to pypi.org
2016
steps:
21-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
2218
with:
2319
fetch-depth: 0
2420
filter: blob:none
2521
- uses: actions/setup-python@v5
2622
with:
2723
python-version: "3.x"
28-
cache: "pip"
29-
- run: pip install build
30-
- run: python -m build
24+
- uses: astral-sh/setup-uv@v6
25+
- run: uvx --from build pyproject-build --sdist --wheel .
26+
- run: uvx twine check dist/*
3127
- uses: pypa/gh-action-pypi-publish@release/v1
File renamed without changes.

pyproject.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,13 @@ single_file = false
299299
package_dir = "src"
300300
issue_format = "{{pr}}`{issue}`"
301301
title_format = "(v{version})=\n### {version} {{small}}`{project_date}`"
302-
fragment.bugfix.name = "Bug fixes"
303-
fragment.doc.name = "Documentation"
304-
fragment.feature.name = "Features"
305-
fragment.misc.name = "Miscellaneous improvements"
306-
fragment.performance.name = "Performance"
307-
fragment.breaking.name = "Breaking changes"
308-
fragment.dev.name = "Development Process"
302+
# Valid fragments should be a subset of conventional commit types (except for `breaking`):
303+
# https://github.com/commitizen/conventional-commit-types/blob/master/index.json
304+
# style, refactor, test, build, ci: should not go into changelog
305+
fragment.feat.name = "Features"
306+
fragment.fix.name = "Bug fixes"
307+
fragment.docs.name = "Documentation"
308+
fragment.perf.name = "Performance"
309+
fragment.chore.name = "Miscellaneous changes"
310+
fragment.revert.name = "Revert"
311+
fragment.breaking.name = "Breaking changes" # add `!` to commit type (e.g. “feature!:”)

0 commit comments

Comments
 (0)