Skip to content

ci: add GitHub Actions workflow enforcing the build gates#85

Merged
OmarAlJarrah merged 1 commit into
mainfrom
ci/add-github-actions
Jun 16, 2026
Merged

ci: add GitHub Actions workflow enforcing the build gates#85
OmarAlJarrah merged 1 commit into
mainfrom
ci/add-github-actions

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

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

  • Triggers on pull_request and push to main; runs on ubuntu-latest.
  • Checks out with submodules: recursive (the styleguide is a git submodule).
  • Sets up a single Temurin JDK 21 and runs ./gradlew build. The build declares Gradle toolchains for JDK 8/11/21 and the foojay resolver (configured in settings.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.
  • Uses gradle/actions/setup-gradle for dependency/build caching, least-privilege permissions: 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-version entries on the setup-java step.

Closes #70

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.
@OmarAlJarrah OmarAlJarrah merged commit 955cd60 into main Jun 16, 2026
1 check passed
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.

Add CI workflows to enforce the build gates on every PR

1 participant