Skip to content

ci: add standalone demoapp tests workflow#296

Closed
rstata wants to merge 4 commits intoairbnb:mainfrom
rstata:ci/standalone-demoapp-tests
Closed

ci: add standalone demoapp tests workflow#296
rstata wants to merge 4 commits intoairbnb:mainfrom
rstata:ci/standalone-demoapp-tests

Conversation

@rstata
Copy link
Collaborator

@rstata rstata commented Mar 7, 2026

Closes the first half of #295, which is to build and test demo apps as "external" builds. (The second half — removing demoapps from the composite build — is a separate change.)

To do this, a new Standalone Demo App Tests workflow publishes all Viaduct artifacts to Maven Local and then tests each demo app in isolation — exactly as an external consumer would use them. This catches dependency-packaging bugs that composite builds hide via source substitution.

Commits

ci: add setup-build composite action and migrate build-and-test to use it

Extracts the setup-javasetup-gradle sequence into .github/actions/setup-build, a composite action with a cache-read-only input. Migrates all five jobs in build-and-test.yml to use it, removing the redundant inline steps and the actions/cache steps that were duplicating what gradle/actions/setup-gradle already manages. Downstream jobs (test, detekt, ktlint, coverage-verification) pass cache-read-only: true — only the build job needs to write the cache.

ci: add standalone demoapp tests workflow

Three-job workflow in .github/workflows/standalone-demoapp-tests.yml:

Job Runs on Purpose
publish-to-maven-local ubuntu / Java 21 ./gradlew publishToMavenLocal; uploads ~/.m2/repository as a workflow artifact
test-demoapps ubuntu / Java 21 (matrix: cli-starter, jetty-starter, ktor-starter, micronaut-starter) Downloads the artifact; runs USE_MAVEN_LOCAL=true ./gradlew test for each app in parallel
test-starwars ubuntu × Java 17+21 (macOS available via workflow_dispatch) Same, for the starwars demo app across Java versions

Also adds USE_MAVEN_LOCAL support to all demoapps' settings.gradle.kts files and adds the new workflow to post-slack-alerts.yml.

The default test-starwars matrix uses Ubuntu only. macOS runner provisioning added ~4 min of queue time with no meaningful benefit (Viaduct publishes platform-independent JARs). macOS can still be selected via workflow_dispatch.

fix(build-logic): clean up warnings surfaced by publishToMavenLocal

Running publishToMavenLocal carefully exposed three pre-existing issues:

  • build-logic:shared applied kotlin-dsl, which internally applies java-gradle-plugin and auto-creates a pluginMaven publication. Combined with an explicit maven publication this produced duplicate publications and a spurious "no valid plugin descriptors" warning. Fixed by switching to kotlin("jvm") (shared has no Gradle API dependencies).
  • test-fixtures and tools publish Gradle capability variants that cannot be expressed in Maven POM format, producing noisy metadata warnings. Suppressed with suppressPomMetadataWarningsFor().
  • versioning.gradle.kts logged the resolved version at lifecycle level on every build. Downgraded to info.

perf(ci): add publishMinimal mode to speed up Maven Local publishing

Introduces a publishMinimal Gradle property that strips everything unnecessary from the publishToMavenLocal path: skips Dokka javadoc generation and sources jars, and excludes the x/javaapi modules entirely from the build graph (avoiding their heavyweight annotation processing). The standalone workflow passes -PpublishMinimal to take advantage of this.

Testing

Verified on rstata/viaduct#1:

  • publish-to-maven-local completes and maven-local-repo artifact is visible in the run
  • All four test-demoapps matrix shards pass in parallel
  • Both test-starwars Java shards (17, 21) pass on Ubuntu
  • collect-failure-info is skipped (no failures)
  • Total wall time: ~6.5 min

🤖 Generated with Claude Code

@rstata rstata force-pushed the ci/standalone-demoapp-tests branch 3 times, most recently from 26386fa to a3897f3 Compare March 8, 2026 11:03
Raymie Stata and others added 4 commits March 8, 2026 18:40
…e it

Introduces .github/actions/setup-build, a composite action that wraps
setup-java and setup-gradle in one reusable step. Migrates all five jobs
in build-and-test.yml to use it, removing the now-redundant inline
setup-java, setup-gradle, and actions/cache steps from each job.

The build job uses the default cache-read-only=false so it can write
the Gradle User Home cache. The four downstream jobs (test, detekt,
ktlint, coverage-verification) pass cache-read-only=true — they only
need to read the cache written by the build job, and writing from all
four simultaneously wastes cache quota and risks evicting useful entries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a GitHub Actions workflow that publishes Viaduct to Maven Local
and tests each demo app against those published artifacts in isolation
(USE_MAVEN_LOCAL=true), catching dependency-packaging bugs that
composite builds mask via source substitution.

- New workflow standalone-demoapp-tests.yml with three jobs:
  publish-to-maven-local (ubuntu/Java 21), test-demoapps (4-app matrix,
  ubuntu/Java 21), test-starwars (ubuntu × Java 17+21 matrix)
- Uses setup-build composite action for Java/Gradle setup; test jobs
  pass cache-read-only=true to avoid redundant cache writes
- Maven Local artifact upload uses compression-level=0 (JARs are
  already compressed) and retention-days=1 (only needed within the run)
- Adds USE_MAVEN_LOCAL support to demoapps/micronaut-starter so it can
  resolve Viaduct from Maven Local instead of the composite build
- Updates post-slack-alerts.yml to alert on the new workflow's failures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three pre-existing issues in build-logic that became visible when
running publishToMavenLocal more carefully:

- build-logic:shared applied kotlin-dsl, which pulls in java-gradle-plugin
  and auto-creates a pluginMaven publication. Combined with the explicit
  maven publication, this produced duplicate publications and a spurious
  "no valid plugin descriptors" warning. Fixed by switching to kotlin("jvm")
  (shared has no Gradle API dependencies) and keeping one explicit publication.

- test-fixtures and tools publish Gradle capability variants that cannot
  be expressed in Maven POM format, generating noisy metadata warnings.
  Suppressed with suppressPomMetadataWarningsFor().

- versioning.gradle.kts logged the resolved version at lifecycle level on
  every build. Downgraded to info.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces a publishMinimal Gradle property that strips out everything
not needed when publishing to Maven Local for local integration testing:

- Skips Dokka javadoc generation and sources jars in viaduct-publishing
  convention (JavadocJar.Empty(), sourcesJar=false)
- Excludes the x/javaapi modules entirely from the build graph via
  included-builds/core/settings.gradle.kts, avoiding their heavyweight
  annotation processing and compilation

The standalone-demoapp-tests workflow passes -PpublishMinimal to the
publishToMavenLocal step to take advantage of this.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rstata rstata force-pushed the ci/standalone-demoapp-tests branch from a3897f3 to 1859a8c Compare March 8, 2026 18:54
@viaductbot viaductbot closed this in 902d286 Mar 8, 2026
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.

1 participant