Skip to content

Commit 817a196

Browse files
chenkasirerclaude
andcommitted
Migrate CI to new-generation compas-actions
Replace compas-actions.build / .docs / .publish and the legacy changelog-checker with the narrow actions from the compas-dev/compas-actions monorepo, following compas_pb. - build/coverage/docs/pr-checks now use ci, setup-python, docs, pr-checks and release-check. - Releases move to the release-PR flow: prepare-release.yml opens a release/vX.Y.Z pull request, and merging it to main drives release.yml (release-check, ci, prepare-release, OIDC publish, github-release, versioned docs deploy). Tag pushes no longer publish. - bump-my-version no longer commits or tags and no longer parses pre-release versions; the release actions accept stable semver only. - Drop the release and prepare-changelog invoke tasks, now owned by the release actions. - Python 3.9 is Rhino 8's Python, so it keeps a dedicated build-py39 job. The ci action installs interpreters with actions/setup-python, which has no darwin-arm64 build for 3.9, so that job uses a uv-managed interpreter the way the previous workflow did. - publish_yak becomes a guarded stub. Its components and invoke tasks moved to timber_design, but a workflow_dispatch workflow must exist on the default branch to be runnable, and LTS-1.x.x still dispatches it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 4b85dc9 commit 817a196

10 files changed

Lines changed: 269 additions & 133 deletions

File tree

.github/workflows/build.yml

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,71 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
12-
Build:
13-
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')"
15+
release-change:
16+
name: Detect release merge
17+
runs-on: ubuntu-latest
18+
outputs:
19+
is-release: ${{ steps.release.outputs.is-release }}
20+
steps:
21+
- uses: compas-dev/compas-actions/release-check@v1
22+
id: release
23+
24+
build:
25+
needs: release-change
26+
if: >-
27+
!contains(github.event.pull_request.labels.*.name, 'docs-only') &&
28+
(github.event_name == 'pull_request' || needs.release-change.outputs.is-release != 'true')
1429
runs-on: ${{ matrix.os }}
1530
strategy:
31+
fail-fast: false
1632
matrix:
1733
os: [macos-latest, windows-latest]
18-
python: ['3.9', '3.12', '3.14']
34+
python: ['3.12', '3.14']
1935

2036
steps:
21-
- uses: actions/checkout@v5
22-
23-
- uses: astral-sh/setup-uv@v7
37+
- uses: compas-dev/compas-actions/ci@v1
2438
with:
2539
python-version: ${{ matrix.python }}
40+
management-tool: uv
41+
extras: dev
42+
run-prebuild: true
43+
invoke-tasks: lint test
44+
45+
# Rhino 8 ships Python 3.9, so it has to stay covered. The ci action installs
46+
# the interpreter with actions/setup-python, which has no darwin-arm64 build
47+
# for 3.9, so this job uses a uv-managed interpreter instead. Tests that need
48+
# the OCC Brep backend are marked `requires_occ` and skipped here, because
49+
# compas_brep[occ] has no 3.9 wheels.
50+
build-py39:
51+
needs: release-change
52+
if: >-
53+
!contains(github.event.pull_request.labels.*.name, 'docs-only') &&
54+
(github.event_name == 'pull_request' || needs.release-change.outputs.is-release != 'true')
55+
runs-on: ${{ matrix.os }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
os: [macos-latest, windows-latest]
60+
61+
steps:
62+
- uses: actions/checkout@v7.0.1
63+
with:
64+
persist-credentials: false
65+
66+
- uses: astral-sh/setup-uv@v10.0.1
67+
with:
68+
python-version: '3.9'
2669
activate-environment: true
27-
28-
- name: Install dependencies
29-
run: |
30-
uv pip install -e ".[dev]"
70+
71+
- name: Install project
72+
run: uv pip install -e ".[dev]"
3173

3274
- name: Run pre-build
33-
run: |
34-
invoke pre-build
75+
run: invoke pre-build
3576

36-
- name: Run tests
37-
run: |
38-
invoke lint
39-
invoke test
77+
- name: Run checks
78+
run: invoke lint test

.github/workflows/coverage.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
coverage:
1316
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')"
1417
runs-on: ubuntu-latest
1518

1619
steps:
17-
- uses: actions/checkout@v5
18-
19-
- uses: astral-sh/setup-uv@v7
20+
- uses: actions/checkout@v7.0.1
2021
with:
21-
python-version: "3.12"
22-
activate-environment: true
22+
persist-credentials: false
2323

24-
- name: Install dependencies
25-
run: |
26-
uv pip install -e ".[dev]"
24+
- uses: compas-dev/compas-actions/setup-python@v1
25+
with:
26+
python-version: '3.12'
27+
management-tool: uv
28+
extras: dev
2729

2830
- name: Run pre-build
29-
run: |
30-
invoke pre-build
31+
run: invoke pre-build
3132

3233
- name: Run tests collecting coverage reports
33-
run: |
34-
pytest --cov src/compas_timber --cov-report=html
34+
- name: Run tests collecting coverage reports
35+
run: pytest --cov src/compas_timber --cov-report=xml --cov-report=term
3536

3637
- name: Upload coverage reports to Codecov
3738
uses: codecov/codecov-action@v5
3839
with:
3940
token: ${{ secrets.CODECOV_TOKEN }}
40-

.github/workflows/docs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@ on:
44
push:
55
branches:
66
- main
7-
tags:
8-
- 'v*'
97
pull_request:
108
branches:
119
- main
1210

11+
permissions:
12+
contents: read
13+
1314
jobs:
14-
docs:
15+
build:
1516
runs-on: ubuntu-latest
1617
steps:
17-
- uses: compas-dev/compas-actions.docs@v5
18+
- uses: compas-dev/compas-actions/docs@v1
1819
with:
19-
github_token: ${{ secrets.GITHUB_TOKEN }}
20-
generator: mkdocs
21-
extras: dev,mkdocs
20+
python-version: '3.12'
21+
extras: dev
22+
config-file: mkdocs.yml
23+
# griffe reports pre-existing docstring/signature mismatches as warnings
24+
strict: false

.github/workflows/pr-checks.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
name: verify-pr-checklist
2+
23
on:
34
pull_request:
45
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
56
branches:
67
- main
78

9+
permissions:
10+
contents: read
11+
812
jobs:
9-
build:
10-
name: Check Actions
13+
release:
14+
name: Validate release metadata
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: compas-dev/compas-actions/release-check@v1
18+
19+
changelog:
20+
name: Check changelog
1121
runs-on: ubuntu-latest
1222
steps:
13-
- uses: actions/checkout@v4
14-
- name: Changelog check
15-
uses: Zomzog/changelog-checker@v1.2.0
23+
- uses: compas-dev/compas-actions/pr-checks@v1
1624
with:
17-
fileName: CHANGELOG.md
18-
checkNotification: Simple
19-
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
changelog-path: CHANGELOG.md
26+
skip-label: no changelog
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: prepare release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release-type:
7+
description: Semantic version component to bump
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
release-pr:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: compas-dev/compas-actions/release-pr@v1
24+
with:
25+
release-type: ${{ inputs.release-type }}
26+
github-token: ${{ github.token }}

.github/workflows/release.yml

Lines changed: 113 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,127 @@ name: release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
710

811
jobs:
9-
Build:
12+
release:
13+
name: Detect release merge
14+
runs-on: ubuntu-latest
15+
outputs:
16+
is-release: ${{ steps.release.outputs.is-release }}
17+
version: ${{ steps.release.outputs.version }}
18+
tag: ${{ steps.release.outputs.tag }}
19+
steps:
20+
- uses: compas-dev/compas-actions/release-check@v1
21+
id: release
22+
23+
build:
24+
needs: release
25+
if: needs.release.outputs.is-release == 'true'
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-latest, macos-latest, windows-latest]
31+
python: ['3.12', '3.14']
32+
steps:
33+
- uses: compas-dev/compas-actions/ci@v1
34+
with:
35+
python-version: ${{ matrix.python }}
36+
management-tool: uv
37+
extras: dev
38+
run-prebuild: true
39+
invoke-tasks: lint test
40+
41+
# See build.yml: 3.9 is Rhino 8's Python and needs a uv-managed interpreter.
42+
build-py39:
43+
needs: release
44+
if: needs.release.outputs.is-release == 'true'
1045
runs-on: ${{ matrix.os }}
1146
strategy:
47+
fail-fast: false
1248
matrix:
13-
os: [ubuntu-latest]
14-
python: ['3.12']
49+
os: [ubuntu-latest, macos-latest, windows-latest]
50+
steps:
51+
- uses: actions/checkout@v7.0.1
52+
with:
53+
persist-credentials: false
54+
55+
- uses: astral-sh/setup-uv@v10.0.1
56+
with:
57+
python-version: '3.9'
58+
activate-environment: true
1559

60+
- name: Install project
61+
run: uv pip install -e ".[dev]"
62+
63+
- name: Run pre-build
64+
run: invoke pre-build
65+
66+
- name: Run checks
67+
run: invoke lint test
68+
69+
prepare:
70+
needs: [release, build, build-py39]
71+
if: needs.release.outputs.is-release == 'true'
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: compas-dev/compas-actions/prepare-release@v1
75+
with:
76+
python-version: '3.12'
77+
management-tool: uv
78+
extras: dev
79+
run-prebuild: true
80+
81+
publish:
82+
needs: [release, prepare]
83+
if: needs.release.outputs.is-release == 'true'
84+
runs-on: ubuntu-latest
85+
environment:
86+
name: pypi
87+
url: https://pypi.org/p/compas-timber
88+
permissions:
89+
contents: read
90+
id-token: write
1691
steps:
17-
- uses: compas-dev/compas-actions.build@v5
92+
- name: Download package distributions
93+
uses: actions/download-artifact@v8.0.1
1894
with:
19-
invoke_lint: true
20-
check_import: false
21-
use_conda: false
22-
invoke_test: true
23-
python: ${{ matrix.python }}
24-
run_prebuild: true
25-
26-
Publish:
27-
needs: Build
95+
name: python-package-distributions
96+
path: dist
97+
98+
- name: Publish package distributions to PyPI
99+
uses: pypa/gh-action-pypi-publish@v1.14.2
100+
101+
create-release:
102+
needs: [release, publish]
103+
if: needs.release.outputs.is-release == 'true'
104+
runs-on: ubuntu-latest
105+
permissions:
106+
contents: write
107+
steps:
108+
- uses: compas-dev/compas-actions/github-release@v1
109+
with:
110+
github-token: ${{ github.token }}
111+
tag-name: ${{ needs.release.outputs.tag }}
112+
target: ${{ github.sha }}
113+
114+
docs:
115+
needs: [release, create-release]
116+
if: needs.release.outputs.is-release == 'true'
28117
runs-on: ubuntu-latest
118+
permissions:
119+
contents: write
29120
steps:
30-
- uses: compas-dev/compas-actions.publish@prebuild_v2 # will be replaced with the new gen build actions in a following PR
121+
- uses: compas-dev/compas-actions/docs@v1
31122
with:
32-
publish_to_pypi: true
33-
pypi_token: ${{ secrets.PYPI }}
34-
github_token: ${{ secrets.GITHUB_TOKEN }}
35-
python: '3.12'
36-
run_prebuild: true
123+
deploy: true
124+
version: ${{ needs.release.outputs.version }}
125+
python-version: '3.12'
126+
extras: dev
127+
config-file: mkdocs.yml
128+
strict: false

0 commit comments

Comments
 (0)