Skip to content

ci: skip release-only artifacts and JaCoCo on Windows, remove duplicate Maven cache - #3526

Merged
xzxiaoshan merged 2 commits into
agentscope-ai:mainfrom
xzxiaoshan:ci/build-time-opt
Oct 13, 2026
Merged

xzxiaoshan merged 2 commits into
agentscope-ai:mainfrom
xzxiaoshan:ci/build-time-opt

Conversation

@xzxiaoshan

Copy link
Copy Markdown
Collaborator

Summary

Two low-risk changes to maven-ci.yml that cut the Windows build job time and halve Maven cache storage. No changes to built artifacts, tests, or repo configuration.

1. Skip release-only artifacts and JaCoCo on the Windows job

The Windows build step now passes:

  • -Dmaven.javadoc.skip=true — javadoc jars are only consumed at release time, and javadoc is one of the slowest phases on Windows runners (the -Dmvnd.maxLostKeepAlive=120 workaround exists precisely because of long javadoc phases)
  • -Dmaven.source.skip=true — source jars are likewise release-only
  • -Djacoco.skip=true — coverage is only uploaded from Linux (Upload coverage reports to Codecov has if: runner.os == 'Linux'), so per-module agent instrumentation + report generation on Windows is pure overhead

The Windows job's purpose is verifying tests pass on Windows; expected reduction is ~25–35% (from ~30 min).

2. Remove duplicate Maven repository cache

actions/setup-java had cache: 'maven' while an explicit actions/cache step caches the exact same ~/.m2/repository path with a different key. Measured impact:

  • Every run paid a double restore (~35–40s)
  • Each dependency generation was stored 4× (~0.86 GB per copy ≈ 3.5 GB per generation), pressuring the 10 GB org cache quota and evicting other workflows' caches

The explicit actions/cache step (written later, restore-keys fallback) remains the single cache source; its key strategy is unchanged.

Why this is safe

  • -Djacoco.skip=true does not break Surefire: argLine has a default value in the root pom.xml (-Xms512m -Xmx1024m), and Surefire references @{argLine}, which resolves to that default when JaCoCo's prepare-agent is skipped
  • Linux job is untouched (it still produces coverage for Codecov)

… maven cache

- Windows build step passes -Dmaven.javadoc.skip=true,
  -Dmaven.source.skip=true and -Djacoco.skip=true: javadoc/source jars
  are release-only artifacts and coverage is only uploaded from Linux,
  so instrumentation on Windows is pure overhead (~25-35% expected
  reduction on the Windows job, which was ~30 min / 94.5% build step).
- Remove cache: 'maven' from actions/setup-java: the explicit
  actions/cache step already caches the same ~/.m2/repository path, so
  the second copy only added ~35s restore per run and ~0.86GB storage
  (4 copies per dependency generation were pressuring the 10GB quota).

Safe for Surefire: argLine has a default value in the root pom and
surefire references @{argLine}, which falls back to it when JaCoCo's
prepare-agent is skipped. Verified locally: agentscope-core tests pass
with all three skip flags and JaCoCo reports 'Skipping JaCoCo
execution because property jacoco.skip is set'.
@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@xzxiaoshan
xzxiaoshan merged commit 2569836 into agentscope-ai:main Oct 13, 2026
6 checks passed
xzxiaoshan added a commit that referenced this pull request Oct 14, 2026
Follow-up to #3526, from the same CI build-time investigation.

## Summary

- Build both the Linux and Windows jobs in parallel with `-T1C` (one
thread per core) using the standard Maven preinstalled on both runners,
replacing the single-threaded `-T1` (Windows previously ran mvnd pinned
to `-T1`, so it never actually built in parallel).
- Drop mvnd entirely from the Windows job: `MVND_VERSION`, the `Cache
mvnd` / `Install mvnd` steps, `mvnd-cache-path` in the matrix, and
`-Dmvnd.maxLostKeepAlive=120`.
- Companion commit (deliberately separate from the workflow change):
raise the hardcoded 10s `.block(...)` timeout in
`AnthropicChatModelAuthenticationTest.assertExchange` to 30s. This was
the only failure observed under heavy parallel test load (32 concurrent
test JVMs) — a test-robustness issue unrelated to build correctness, but
one that would pollute the CI signal under `-T1C`.

## Why `-T1` can be lifted

- `-T1` was introduced in #910 to keep reactor order so agentscope-core
is built before the modules that resolve it. That rationale does not
hold: `clean verify` never installs anything, and Maven's parallel
builder schedules modules by the dependency graph, so reactor ordering
is guaranteed at any thread count.
- The failure `-T1` actually papered over was spotless lock contention
under mvnd's parallel execution (`spotless-maven-plugin:check failed:
Could not acquire lock(s)`, about a dozen modules). Reproduced locally
on the #910 tree with mvnd 1.0.3 at default parallelism; the same tree
with standard Maven at `-T1C` (32 threads) builds clean, and spotless
3.3.0/3.4.0 under 12-way standard-Maven concurrency shows no lock
errors. The module that originally triggered it was removed in cc3b2ee
(2026-06).
- Linux already builds with standard Maven because of mvnd problems (the
embedded distribution broke Surefire IPC, #3080). Moving Windows to
standard `mvn` removes the remaining mvnd-specific failure sources plus
the mvnd install/cache overhead.

## Rollback

Workflow/command-line-level change only — no artifact content changes;
reverting the commit fully rolls back.
jujn pushed a commit that referenced this pull request Oct 14, 2026
…#3543)

Follow-up to #3526 and #3539 from the same CI build-time effort. Two
independent workflow-level changes, split into separate commits.

## Summary

- Add a workflow-level `concurrency` group so a new push to a PR cancels
that PR's superseded in-flight run. Pushes to main are unaffected: they
use a separate group, and `cancel-in-progress` is only true for
`pull_request` events.
- On the Linux build step, skip javadoc/source jars — but only for
`pull_request`-triggered runs, via an event-gated env var
(`PR_SKIP_FLAGS`). Pushes to main still build them, so javadoc/doclint
breakage still surfaces on main before a release. The pom is untouched:
local builds and the release process behave exactly as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants