Skip to content

Commit 3d016ab

Browse files
ci: refactor workflows to use reusable actions and update deps (#158)
Refactor CI workflows to use centralized reusable workflows from xenoterracide/github repository for license and format checks. This reduces duplication and simplifies maintenance across projects. - Replace inline license and format job steps with reusable workflow calls - Update copyright year format to use en dash consistently (2024-2026) - Add requirements.txt to REUSE.toml annotations - Update requirements.txt with hash verification and Python 3.14 - Remove obsolete lintstaged rule for Python requirements - Fix checkout ref in shared workflow to use github.ref
2 parents 4db2010 + a952ed4 commit 3d016ab

File tree

5 files changed

+252
-77
lines changed

5 files changed

+252
-77
lines changed

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,18 @@
1-
# SPDX-FileCopyrightText: Copyright © 2024 - 2025 Caleb Cushing
1+
# SPDX-FileCopyrightText: Copyright © 2024-2026 Caleb Cushing
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

55
name: precommit
66
on: [push, workflow_call]
77
jobs:
88
license:
9-
runs-on: ubuntu-24.04
10-
timeout-minutes: 5
11-
steps:
12-
- &checkout-step
13-
uses: actions/checkout@v6.0.2
14-
with:
15-
ref: ${{ github.event.workflow_run.head_branch }}
16-
filter: "blob:none"
17-
fetch-depth: 0
18-
- uses: actions/setup-python@v6.2.0
19-
with:
20-
python-version: "3"
21-
- run: pip install -r requirements.txt
22-
- run: reuse lint
9+
uses: xenoterracide/github/.github/workflows/license.yml@a16c3df4daebc100dc0c2d138ab23c6b03b0ca4a
2310
format:
24-
runs-on: ubuntu-24.04
25-
timeout-minutes: 5
26-
steps:
27-
- *checkout-step
28-
- uses: actions/setup-node@v6.2.0
29-
with:
30-
node-version: 24
31-
package-manager-cache: false
32-
- run: corepack enable
33-
- uses: actions/setup-node@v6.2.0
34-
with:
35-
node-version: 24
36-
cache: "yarn"
37-
- run: yarn install --immutable --inline-builds --check-resolutions
38-
- run: yarn exec prettier --ignore-unknown --check '**'
11+
uses: xenoterracide/github/.github/workflows/format.yml@a16c3df4daebc100dc0c2d138ab23c6b03b0ca4a
3912
format-kotlin:
4013
runs-on: ubuntu-24.04
4114
steps:
42-
- *checkout-step
15+
- uses: actions/checkout@v6.0.2
4316
- uses: actions/setup-java@v5.2.0
4417
with:
4518
distribution: temurin

.lintstagedrc.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright © 2024 - 2026 Caleb Cushing
1+
# SPDX-FileCopyrightText: Copyright © 2024-2026 Caleb Cushing
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

@@ -28,6 +28,3 @@
2828
"*.properties": # Tools such as IntelliJ IDEA do not treat .properties files as UTF-8 by default
2929
- "reuse annotate --license 'CC0-1.0' --copyright 'Caleb Cushing' --merge-copyrights"
3030
- *prettier
31-
# Python requirements
32-
"requirements.*":
33-
- "reuse annotate --license 'CC0-1.0' --copyright 'Caleb Cushing' --copyright-prefix spdx-string-symbol --merge-copyrights --style python"

.share/.github/workflows/pre-commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- &checkout-step
1212
uses: actions/checkout@v6.0.2
1313
with:
14-
ref: ${{ github.event.workflow_run.head_branch }}
14+
ref: ${{ github.ref }}
1515
filter: "blob:none"
1616
fetch-depth: 0
1717
- uses: actions/setup-python@v6.2.0

REUSE.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright © 2024 - 2025 Caleb Cushing
1+
# SPDX-FileCopyrightText: Copyright © 2024-2026 Caleb Cushing
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

@@ -12,10 +12,17 @@ SPDX-License-Identifier = "CC0-1.0"
1212
path = "yarn.lock"
1313
SPDX-FileCopyrightText = "NONE"
1414
SPDX-License-Identifier = "CC0-1.0"
15+
1516
[[annotations]]
1617
path = ".tool-versions"
1718
SPDX-FileCopyrightText = "NONE"
1819
SPDX-License-Identifier = "CC0-1.0"
20+
21+
[[annotations]]
22+
path = "requirements.txt"
23+
SPDX-FileCopyrightText = "NONE"
24+
SPDX-License-Identifier = "CC0-1.0"
25+
1926
[[annotations]]
2027
path = "gradle/wrapper/gradle-wrapper.jar"
2128
SPDX-FileCopyrightText = "See MANIFEST.MF in jar"

0 commit comments

Comments
 (0)