Skip to content

ci: run the lint jobs on ubuntu instead of macos - #743

Open
jamesnrokt wants to merge 2 commits into
mainfrom
ci/lint-jobs-on-ubuntu
Open

ci: run the lint jobs on ubuntu instead of macos#743
jamesnrokt wants to merge 2 commits into
mainfrom
ci/lint-jobs-on-ubuntu

Conversation

@jamesnrokt

Copy link
Copy Markdown
Collaborator

Background

Lint Checks and Kotlin Lint Checks are the last two jobs on macos-latest, which GitHub bills at a 10× multiplier. On the most recent full run they accounted for ~12.7 minutes of wall time — roughly 127 billed minutes, the most expensive thing in the suite for the cheapest work in it.

The runner is a leftover. git log -S traces it to the 2021 Actions migration (b198d1e), where macos-latest was picked for the emulator job, because macOS was then the only runner with hardware-accelerated Android emulation. The emulator jobs have since moved to ubuntu-latest with explicit KVM enablement, so the one workload that genuinely needed macOS no longer uses it — the lint jobs just inherited the runner.

Nothing they run is platform-specific: Android Lint, ktlint and publishMavenPublicationToMavenLocal. There is no darwin, xcode, brew or os.name reference anywhere in the build.

What changed

  • lint-checks and kotlin-lint-checks: runs-on: macos-latestubuntu-latest.

Validation

kit-compatibility-test already runs publishMavenPublicationToMavenLocal plus kit release builds on ubuntu-latest and passes — a heavier Gradle workload than lint, on the same toolchain — so the toolchain is proven on Linux in this repo. ubuntu-latest also has more memory than macos-latest (16 GB vs 14 GB).

I cannot prove this locally, having no Linux runner, so CI on this PR is the real test. If either job fails for a genuinely platform-specific reason, close this PR and leave the runner alone.

Independent of #742, which also touches pull-request.yml; the two edit different lines and I verified they merge cleanly in either order.

Lint Checks and Kotlin Lint Checks are the last two jobs on macos-latest, which
carries a 10x billing multiplier. Nothing they run needs macOS: Android Lint,
ktlint and publishMavenPublicationToMavenLocal are all platform-independent, and
there is no darwin/xcode/brew reference anywhere in the build.

The macOS runner is a leftover. It arrived in 2021 when the emulator job needed
macOS for hardware-accelerated Android emulation, before GitHub's Linux runners
exposed KVM. The emulator jobs have since moved to ubuntu-latest with explicit
KVM enablement, so the reason no longer applies to anything in this workflow.

kit-compatibility-test already runs publishMavenPublicationToMavenLocal plus kit
builds on ubuntu-latest, which is a heavier Gradle workload than lint, so the
required toolchain is demonstrably fine on Linux in this repo. ubuntu-latest also
has more memory than macos-latest (16 GB vs 14 GB).

Secondary benefit: these jobs now share the Linux Gradle User Home cache written
on main, rather than needing their own macOS/arm64 entries.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jamesnrokt
jamesnrokt requested a review from a team as a code owner July 29, 2026 21:06
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
CI-only runner change with no application or build-script edits; risk is limited to possible platform-specific Gradle/lint behavior on Linux, which the PR author expects CI to validate.

Overview
Moves lint-checks and kotlin-lint-checks in pull-request.yml from macos-latest to ubuntu-latest, aligning them with the rest of the PR workflow (unit tests, kit compatibility, etc.).

Gradle steps are unchanged—Android Lint, ktlint, and publishMavenPublicationToMavenLocal—so this is a runner swap aimed at lower GitHub Actions cost (macOS billed at a higher multiplier) rather than a change to what gets validated.

Reviewed by Cursor Bugbot for commit 63fe6f9. Bugbot is set up for automated code reviews on this repo. Configure here.

@sonarqubecloud

Copy link
Copy Markdown

jamesnrokt added a commit that referenced this pull request Jul 30, 2026
…746)

* ci: remove hardcoded secrets check from PR workflow

Trunk already runs trufflehog at the PR level (trufflehog@3.90.6 in
.trunk/trunk.yaml), alongside a custom mparticle-api-key-check rule, so
this job was duplicating secret scanning that Trunk Check already covers.

The job was also intermittently red -- 3 failures in 70 recent runs, always
in ~5s. It failed on #742 while passing on #743 and #744 with identical
config. The cause is in the reusable workflow, which resolves and downloads
"latest" trufflehog at runtime by curling the GitHub releases API and
grepping the response; that step breaks when the API rate-limits. Trunk
pins its trufflehog version and has no runtime download, so it does not
share this failure mode.

Nothing in the workflow depends on the removed job; no other job referenced
it via needs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: enable trufflehog-git to scan the commits a PR adds

The already-enabled trufflehog linter runs `trufflehog filesystem` against
changed files in the working tree, so it cannot see a secret that was
committed and then removed in a later commit on the same branch -- the file
no longer exists to scan.

trufflehog-git closes that gap. It runs `trufflehog git --since-commit
${upstream-ref}`, walking only the commits the PR adds, so it stays fast
(~1.7s) and does not resurface historical findings.

Demonstrated with a private key committed then removed on a branch:

  filesystem scan  -> missed it (only the pre-existing daily.yml FP)
  git-history scan -> PrivateKey <- probe-key.pem @ f48c6617

Both linters keep Trunk's default --only-verified, so this widens scan
scope, not the reporting threshold.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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