Skip to content

Commit 42f7cf0

Browse files
ci: test imported agent-notify module
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8c20a4d commit 42f7cf0

2 files changed

Lines changed: 100 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
outputs:
1818
code_graph: ${{ steps.filter.outputs.code_graph }}
1919
evidence_ledger: ${{ steps.filter.outputs.evidence_ledger }}
20+
notify: ${{ steps.filter.outputs.notify }}
2021
steps:
2122
- uses: actions/checkout@v5
2223
- uses: dorny/paths-filter@v3
@@ -31,6 +32,10 @@ jobs:
3132
- 'engines/evidence-ledger/**'
3233
- 'src/brigade/templates/components/manifest-v1.json'
3334
- '.github/workflows/ci.yml'
35+
notify:
36+
- 'stations/notify/**'
37+
- 'src/brigade/templates/components/manifest-v1.json'
38+
- '.github/workflows/ci.yml'
3439
3540
code-graph-msrv:
3641
name: MSRV (Rust 1.85)
@@ -147,6 +152,50 @@ jobs:
147152
- run: scripts/smoke_mcp.sh
148153
- run: scripts/smoke_http.sh
149154

155+
notify-build-and-test:
156+
name: notify-build-and-test (ubuntu-latest)
157+
needs: changes
158+
if: ${{ needs.changes.outputs.notify == 'true' }}
159+
runs-on: ubuntu-latest
160+
defaults:
161+
run:
162+
working-directory: stations/notify
163+
steps:
164+
- uses: actions/checkout@v5
165+
- uses: actions/setup-go@v5
166+
with:
167+
go-version: '1.22'
168+
- name: Build
169+
run: go build ./...
170+
- name: Vet
171+
run: go vet ./...
172+
- name: Test
173+
run: go test -race ./...
174+
- name: Install govulncheck
175+
run: go install golang.org/x/vuln/cmd/govulncheck@v1.3.0
176+
- name: Vulncheck
177+
run: govulncheck ./...
178+
179+
notify-windows:
180+
name: notify-build-and-test (windows-latest)
181+
needs: changes
182+
if: ${{ needs.changes.outputs.notify == 'true' }}
183+
runs-on: windows-latest
184+
defaults:
185+
run:
186+
working-directory: stations/notify
187+
steps:
188+
- uses: actions/checkout@v5
189+
- uses: actions/setup-go@v5
190+
with:
191+
go-version: '1.22'
192+
- name: Build
193+
run: go build ./...
194+
- name: Vet
195+
run: go vet ./...
196+
- name: Test
197+
run: go test -race ./...
198+
150199
lint:
151200
runs-on: ubuntu-latest
152201
steps:

tests/test_ci_workflow.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ def test_ci_workflow_path_filter_has_valid_structure_and_engine_paths():
2222
assert "uses: dorny/paths-filter@v3" in changes
2323
assert "code_graph: ${{ steps.filter.outputs.code_graph }}" in changes
2424
assert "evidence_ledger: ${{ steps.filter.outputs.evidence_ledger }}" in changes
25+
assert "notify: ${{ steps.filter.outputs.notify }}" in changes
2526
assert "code-graph:" not in changes
2627
assert "evidence-ledger:" not in changes
28+
assert "stations/notify:" not in changes
2729

2830
for path in (
2931
"engines/code-graph/**",
3032
"engines/evidence-ledger/**",
33+
"stations/notify/**",
3134
"src/brigade/templates/components/manifest-v1.json",
3235
".github/workflows/ci.yml",
3336
):
@@ -63,6 +66,23 @@ def test_ci_workflow_gates_native_engine_jobs_with_valid_expressions():
6366
assert "self-hosted" not in section
6467

6568

69+
def test_ci_workflow_gates_notify_jobs_with_valid_expressions():
70+
text = (ROOT / ".github/workflows/ci.yml").read_text()
71+
expected_jobs = {
72+
"notify-build-and-test": "notify",
73+
"notify-windows": "notify",
74+
}
75+
76+
job_names = re.findall(r"^ ([a-z0-9][a-z0-9-]*):$", text, re.MULTILINE)
77+
assert {name for name in job_names if name.startswith("notify-")} == set(expected_jobs)
78+
79+
for job_name, output_name in expected_jobs.items():
80+
section = _workflow_job_section(text, job_name)
81+
assert "needs: changes" in section
82+
assert f"if: ${{{{ needs.changes.outputs.{output_name} == 'true' }}}}" in section
83+
assert "self-hosted" not in section
84+
85+
6686
def test_ci_workflow_runs_embedded_engine_commands_from_engine_directories():
6787
text = (ROOT / ".github/workflows/ci.yml").read_text()
6888

@@ -106,6 +126,37 @@ def test_ci_workflow_runs_embedded_engine_commands_from_engine_directories():
106126
assert command in evidence_ledger
107127

108128

129+
def test_ci_workflow_runs_notify_go_commands_from_notify_directory():
130+
text = (ROOT / ".github/workflows/ci.yml").read_text()
131+
132+
ubuntu = _workflow_job_section(text, "notify-build-and-test")
133+
assert "runs-on: ubuntu-latest" in ubuntu
134+
assert "working-directory: stations/notify" in ubuntu
135+
assert "uses: actions/setup-go@v5" in ubuntu
136+
assert "go-version: '1.22'" in ubuntu
137+
for command in (
138+
"go build ./...",
139+
"go vet ./...",
140+
"go test -race ./...",
141+
"go install golang.org/x/vuln/cmd/govulncheck@v1.3.0",
142+
"govulncheck ./...",
143+
):
144+
assert command in ubuntu
145+
146+
windows = _workflow_job_section(text, "notify-windows")
147+
assert "runs-on: windows-latest" in windows
148+
assert "working-directory: stations/notify" in windows
149+
assert "uses: actions/setup-go@v5" in windows
150+
assert "go-version: '1.22'" in windows
151+
for command in (
152+
"go build ./...",
153+
"go vet ./...",
154+
"go test -race ./...",
155+
):
156+
assert command in windows
157+
assert "govulncheck" not in windows
158+
159+
109160
def test_ci_workflow_does_not_skip_docs_only_content_guard():
110161
text = (ROOT / ".github/workflows/ci.yml").read_text()
111162

0 commit comments

Comments
 (0)