Skip to content

Commit b6ae115

Browse files
committed
ci: align workflows with wamp-cicd patterns
- Add identifiers job using wamp-cicd reusable workflow - Add permissions block (contents: read, pull-requests: read) - Add submodules: recursive to all checkout steps - Add environment variables from identifiers outputs to all jobs - Add coverage report artifact upload step - Update build-package to depend on identifiers job This aligns txaio workflows with autobahn-python patterns for consistent CI/CD across the WAMP project group. Note: This work was completed with AI assistance (Claude Code).
1 parent e18252f commit b6ae115

1 file changed

Lines changed: 51 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,40 @@ on:
77
branches: [master]
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
1014
env:
1115
UV_CACHE_DIR: ${{ github.workspace }}/.uv-cache
1216

1317
jobs:
18+
identifiers:
19+
# GitHub needs to know where .cicd/workflows/identifiers.yml lives at parse time,
20+
# and submodules aren't included in that context! thus the following does NOT work:
21+
# uses: ./.cicd/workflows/identifiers.yml
22+
# we MUST reference the remote repo directly:
23+
uses: wamp-proto/wamp-cicd/.github/workflows/identifiers.yml@main
24+
# IMPORTANT: we still need .cicd as a Git submodule in the using repo though!
25+
# because e.g. identifiers.yml wants to access scripts/sanitize.sh !
26+
1427
quality-checks:
1528
name: Code Quality Checks
29+
needs: identifiers
1630
runs-on: ubuntu-24.04
1731

32+
env:
33+
BASE_REPO: ${{ needs.identifiers.outputs.base_repo }}
34+
BASE_BRANCH: ${{ needs.identifiers.outputs.base_branch }}
35+
PR_NUMBER: ${{ needs.identifiers.outputs.pr_number }}
36+
PR_REPO: ${{ needs.identifiers.outputs.pr_repo }}
37+
PR_BRANCH: ${{ needs.identifiers.outputs.pr_branch }}
38+
1839
steps:
1940
- name: Checkout code
2041
uses: actions/checkout@v4
42+
with:
43+
submodules: recursive
2144

2245
- name: Install Just
2346
env:
@@ -72,13 +95,31 @@ jobs:
7295
- name: Run tests with coverage report
7396
run: just check-coverage cpy314
7497

98+
- name: Upload coverage report
99+
if: always()
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: coverage-report
103+
path: docs/_build/html/coverage/
104+
retention-days: 14
105+
75106
documentation:
76107
name: Documentation Build
108+
needs: identifiers
77109
runs-on: ubuntu-24.04
78110

111+
env:
112+
BASE_REPO: ${{ needs.identifiers.outputs.base_repo }}
113+
BASE_BRANCH: ${{ needs.identifiers.outputs.base_branch }}
114+
PR_NUMBER: ${{ needs.identifiers.outputs.pr_number }}
115+
PR_REPO: ${{ needs.identifiers.outputs.pr_repo }}
116+
PR_BRANCH: ${{ needs.identifiers.outputs.pr_branch }}
117+
79118
steps:
80119
- name: Checkout code
81120
uses: actions/checkout@v4
121+
with:
122+
submodules: recursive
82123

83124
- name: Install Just
84125
env:
@@ -130,7 +171,14 @@ jobs:
130171
build-package:
131172
name: Package Build
132173
runs-on: ubuntu-24.04
133-
needs: [quality-checks]
174+
needs: [identifiers, quality-checks]
175+
176+
env:
177+
BASE_REPO: ${{ needs.identifiers.outputs.base_repo }}
178+
BASE_BRANCH: ${{ needs.identifiers.outputs.base_branch }}
179+
PR_NUMBER: ${{ needs.identifiers.outputs.pr_number }}
180+
PR_REPO: ${{ needs.identifiers.outputs.pr_repo }}
181+
PR_BRANCH: ${{ needs.identifiers.outputs.pr_branch }}
134182

135183
strategy:
136184
matrix:
@@ -139,6 +187,8 @@ jobs:
139187
steps:
140188
- name: Checkout code
141189
uses: actions/checkout@v4
190+
with:
191+
submodules: recursive
142192

143193
- name: Install Just
144194
env:

0 commit comments

Comments
 (0)