ci: add GitHub Actions workflow enforcing the build gates#85
Merged
Conversation
The quality gates (tests, ktlint, detekt, apiCheck, explicit-API strict mode, allWarningsAsErrors, and the aggregate 80% Kover coverage floor) previously ran only on developer machines, so a PR could merge while breaking any of them. Add .github/workflows/ci.yml that runs `./gradlew build` on every pull request and on pushes to main. `./gradlew build` already chains the full gate, so the workflow stays minimal: - Checks out submodules recursively (the styleguide directory is a submodule). - Installs a single Temurin JDK 21. The foojay-resolver-convention plugin auto-provisions the JDK 8 and JDK 11 toolchains the modules need, and JDK 21 covers the virtual-threads module. JDK 21 (not the newest LTS) is deliberate: detekt 1.23.x crashes on JDK 25+, so the daemon stays on 21 to keep detekt green. - Uses gradle/actions/setup-gradle for dependency and build caching. Also add a CI status badge to the README.
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.
Summary
The repository has no CI, so the build gates (tests, ktlint, detekt, apiCheck, and the aggregate Kover coverage floor) are only enforced on developer machines. This adds a GitHub Actions workflow that runs the full gated build on every pull request and on pushes to
main.Details
pull_requestandpushtomain; runs onubuntu-latest.submodules: recursive(the styleguide is a git submodule)../gradlew build. The build declares Gradle toolchains for JDK 8/11/21 and the foojay resolver (configured insettings.gradle.kts) provisions them, so one JDK on the runner is sufficient. JDK 21 is chosen deliberately for the Gradle daemon: detekt 1.23.x crashes on JDK 25+ when analyzing a module that targets a non-8 toolchain, so a 21 daemon keeps the detekt-enabled modules green.gradle/actions/setup-gradlefor dependency/build caching, least-privilegepermissions: contents: read, and a concurrency group that cancels superseded runs. Action versions are pinned.Note for the first run
The workflow relies on the foojay toolchain download to provision JDK 8 and 11 on the runner (this can't be exercised locally, where those toolchains already exist). If a runner ever cannot reach the download repository, add JDK 8 and 11 as additional
java-versionentries on thesetup-javastep.Closes #70