Skip to content

Commit 60cc35a

Browse files
committed
fix: Ensure go.mod tidy is executed before WireGuard tests in CI workflow
1 parent d50a163 commit 60cc35a

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ jobs:
4040
run: ./run lib core
4141
- name: WireGuard endpoint schema and box tests
4242
working-directory: libcore
43-
run: go test -v -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api' -run 'Test(WireGuardEndpointConfigsCreateAndClose|MissingWireGuardRouteTagDoesNotFallbackToDirect|LegacyWireGuardOutboundIsRejected)$' .
43+
# go.sum is generated in CI and intentionally not committed. Prepare it
44+
# here even when the AAR cache skips Native Build (and its go mod tidy).
45+
run: |
46+
go mod tidy
47+
go test -v -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api' -run 'Test(WireGuardEndpointConfigsCreateAndClose|MissingWireGuardRouteTagDoesNotFallbackToDirect|LegacyWireGuardOutboundIsRejected)$' .
4448
- name: Verify LibCore AAR
4549
run: |
4650
test -s app/libs/libcore.aar

tools/diagnostics/roo_check_wireguard_endpoint.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ def main() -> None:
7474
f"missing={sorted(production_tags - ci_test_tags)}, "
7575
f"extra={sorted(ci_test_tags - production_tags)}"
7676
)
77+
ci_tidy_index = ci_workflow.find("go mod tidy")
78+
ci_wireguard_test_index = ci_workflow.find(
79+
"go test -v -tags='with_conntrack,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api'"
80+
)
81+
if ci_tidy_index == -1 or ci_wireguard_test_index == -1 or ci_tidy_index > ci_wireguard_test_index:
82+
raise SystemExit(
83+
"WireGuard Go tests must generate the ignored libcore/go.sum before execution"
84+
)
7785

7886
diagnostic_lines = [
7987
line.strip()

0 commit comments

Comments
 (0)