Skip to content

Refactor CI workflow to separate jobs and optimize matrix - #3047

Merged
Goooler merged 1 commit into
mainfrom
g/20260910/polish-ci
Sep 11, 2026
Merged

Goooler merged 1 commit into
mainfrom
g/20260910/polish-ci

Conversation

@Goooler

@Goooler Goooler commented Sep 10, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The workflow currently uses a likely-invalid runner label (ubuntu-slim) and the new jobs omit build cache credentials, which can break the final gate and significantly reduce CI cache effectiveness.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR refactors the GitHub Actions CI workflow by splitting the previous combined matrix job into distinct jobs per build/test area, aiming to improve parallelism and make the CI surface easier to reason about.

Changes:

  • Split the prior combined build matrix into dedicated jobs: build-gradle, build-maven, test-npm, test-shfmt, and test-idea.
  • Add per-job JUnit reporting to surface test failures directly in PR checks.
  • Update final-status to depend on the new job set.
File summaries
File Description
.github/workflows/ci.yml Splits CI into separate build/test jobs with updated matrices and per-job JUnit reporting, and updates the final required status gate accordingly.
Review details

Suppressed comments (4)

.github/workflows/ci.yml:74

  • This job runs Gradle builds but doesn’t set buildcacheuser/buildcachepass. With CI remote build cache enabled (see settings.gradle), leaving these unset disables cache pushes for trusted builds and can increase CI times.
    runs-on: ${{ matrix.os }}
    steps:

.github/workflows/ci.yml:114

  • This job runs Gradle (testShfmt) but doesn’t set buildcacheuser/buildcachepass. With remote build cache enabled in CI (settings.gradle), this prevents cache pushes on trusted builds and can slow CI.
    needs: sanity-check
    runs-on: ubuntu-latest
    steps:

.github/workflows/ci.yml:94

  • This job executes Gradle tasks but doesn’t pass buildcacheuser/buildcachepass, which prevents remote build cache pushes on trusted builds (CI remote cache is configured in settings.gradle). Consider aligning with the sanity-check job so CI remains fast.
    needs: sanity-check
    runs-on: ubuntu-latest
    steps:

.github/workflows/ci.yml:141

  • This job runs Gradle (testIdea) but doesn’t set buildcacheuser/buildcachepass. In CI, settings.gradle configures a remote build cache and only enables pushing when these are provided, so omitting them here reduces cache effectiveness and can increase CI time.
    needs: sanity-check
    runs-on: ubuntu-latest
    steps:
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml
Comment on lines +45 to +46
runs-on: ${{ matrix.os }}
steps:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this for now? But it should only be set on main pushes, see

spotless/settings.gradle

Lines 34 to 42 in cd8b6e2

// but we only push if it's a trusted build (not PRs)
String user = cred('buildcacheuser')
String pass = cred('buildcachepass')
if (user != null && pass != null) {
push = true
credentials {
username = user
password = pass
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's okay with me if it gets removed, but I believe the buildcache is working and does gain us a fair amount of speedup.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refined a bit.

# Only push to the remote build cache on push events to prevent cache pollution and poisoning from PRs.
buildcacheuser: ${{ github.event_name == 'push' && secrets.BUILDCACHE_USER || '' }}
buildcachepass: ${{ github.event_name == 'push' && secrets.BUILDCACHE_PASS || '' }}
steps:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Goooler
Goooler force-pushed the g/20260910/polish-ci branch from b66f86c to 07213de Compare September 11, 2026 01:41
@Goooler
Goooler enabled auto-merge September 11, 2026 01:52
@Goooler
Goooler merged commit 6063a75 into main Sep 11, 2026
27 checks passed
@Goooler
Goooler deleted the g/20260910/polish-ci branch September 11, 2026 02:19
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.

3 participants