Repository navigation
Speed up CI and make its builds visible - #16
Merged
Merged
Conversation
Gradle in GitHub Actions: - setup-gradle (gradle/actions v6.3.0, the latest release) uses its default enhanced cache provider, which is free for public repositories, instead of the basic one. It saves the Gradle User Home, the local build cache included, from main only, and every other run restores it read-only, as the action recommends. - Gradle's build cache is on (org.gradle.caching), so compiled classes, generated code and javadoc come from that cache. Only cacheable task types use it; the Docker builds and the fixtures always run. - Every Gradle build publishes a Build Scan to scans.gradle.com, the job summary lists the builds with their scans, and a failing build is also summarized as a pull request comment (pull-requests: write, granted by both callers of the reusable workflow). - A new dependency-submission workflow submits the resolved Gradle dependencies to GitHub's dependency graph on every push to main, which Dependabot alerts and security updates for them are based on. Docker layer caching: - The native bundle builds, which Gradle runs with docker buildx, restore every stage from the GitHub Actions cache with -PdockerCache=gha, and export them with mode=max when -PdockerCacheWrite=true. CI writes only on main, like the Gradle cache, so pull requests read main's layers without evicting them. A docker-container buildx builder, selected through BUILDX_BUILDER, and ghaction-github-runtime provide what the gha cache needs; the default builder stays in use for everything else. The packaged smoke's runtime image uses the same cache. - Both native bundle Dockerfiles now compile the collector's Cargo dependencies, the vendored libbpf, elfutils and zlib among them, in a stage of their own from a placeholder crate, with the same RUSTFLAGS as the real build. A collector change then rebuilds only the collector: locally, the x86-64 glibc and musl bundles rebuild in 32 s instead of 102 s after a collector-only change. Test progress: the fixtures are main-based JavaExec tasks, so Gradle's test logging does not apply. Each fixture task now reports its class as STARTED and PASSED with its duration, and fixtures made of scenario methods report each scenario as STARTED, PASSED or FAILED with its time (FixtureSteps).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI improvements: Gradle build visibility and caching, Docker layer caching, a dependency-submission workflow, and per-fixture test progress in the console.
Gradle
cache-provider: basic. Per Caching build state between Jobs, the default is kept: cache entries are written frommainonly and every other run restores them read-only. PR-scoped entries could only be reused by re-runs of the same PR and would evictmain's.org.gradle.caching=true), so its entries travel in the Gradle User Home the action caches. Only cacheable task types (JavaCompile,Javadoc, and similar) use it. The Docker builds (Exec) and the fixtures (JavaExec) always run.add-job-summary-as-pr-comment: on-failure). The comment needspull-requests: write, whichci.ymland the release workflow'sbuild-and-verifyjob now grant to the reusable workflow.dependency-submission.ymlrunsgradle/actions/dependency-submissionon pushes tomain(and manually). It submits the resolved Gradle dependencies to GitHub's dependency graph, which Dependabot alerts and security updates for them use.Docker layer caching
Exec→docker buildx build) take-PdockerCache=ghato restore all stages from the GitHub Actions cache (--cache-from type=gha,scope=native-bundle-<platform>). With-PdockerCacheWrite=truethey also export them (mode=max,ignore-error=true). CI writes only onmain, for the same reason as the Gradle cache.docker/setup-buildx-action(v4.4.1,use: false) creates a docker-container builder, which the builds select throughBUILDX_BUILDER; the default builder stays in use for everything else.crazy-max/ghaction-github-runtime(v4.0.0) exposes the Actions cache runtime thattype=ghaneeds.docker buildx build --load) whenJONOFFCPU_DOCKER_CACHE=gha.build.rs, so the build dependencies compile there too, and the stage uses the sameRUSTFLAGSas the real build; the musl flags now live in one file used by both. The placeholder's fingerprints are removed so the real crate always rebuilds. Measured locally (x86-64 glibc + musl, collector-only change): 102 s → 32 s, withlibbpf-sysno longer recompiled.Test progress in the console
The fixtures are main-based
JavaExectasks, notTesttasks, so Gradle'stestLoggingdoesn't apply. Instead:<class> STARTEDand<class> PASSED (<s> s)(root build script);<Fixture> > <scenario> STARTED/PASSED (<ms> ms)/FAILED (<ms> ms): <error>through a smallFixtureStepshelper. That covers 62 scenarios inSignalCaptureControllerTest,StackProfileTest,StreamingCorrelatorTest,PartialCorrelatorTest,PrimitiveStructuresTest,StackTransformsTest,CommandLineTestandFixtureAcceptanceTest. Fixtures with a single inlinemainreport at class level.Verification
./gradlew spotlessCheck :jonoffcpu-agent:check :jonoffcpu-correlator:check -PnativeArchitectures=x86_64 -PnativeLibcs=allpasses locally with the new Dockerfiles and the build cache enabled, with the progress lines in the output.-PdockerCache=bogusfails withUnsupported dockerCache value 'bogus'; expected none or gha.ubuntu-26.04runner labels it doesn't know yet.mainafter merge.