Skip to content

ci: add Trunk CI workflow (Check + Merge Queue + Flaky Tests)#1015

Closed
IgorGanapolsky wants to merge 1 commit intodevelopfrom
chore/add-trunk-ci
Closed

ci: add Trunk CI workflow (Check + Merge Queue + Flaky Tests)#1015
IgorGanapolsky wants to merge 1 commit intodevelopfrom
chore/add-trunk-ci

Conversation

@IgorGanapolsky
Copy link
Copy Markdown
Owner

What

Adds .github/workflows/trunk.yml to integrate Trunk into the CI pipeline for Random-Timer.

Why

Completes Step 5 of the Trunk onboarding checklist:

  • Trunk Check runs on every PR and push, posting inline annotations
  • merge_group trigger enables the Trunk Merge Queue to validate batched PRs before they land on develop
  • Flaky Test upload sends Android (JUnit XML) and iOS (XCTest) test results to Trunk's Flaky Test detection dashboard

Required Action Before Merging

⚠️ Add TRUNK_TOKEN as a Repository Secret before this workflow runs:

  1. Get token from app.trunk.io/igor-personal → Settings → Repositories
  2. Go to GitHub Secrets → New repository secret
  3. Name: TRUNK_TOKEN, Value: (paste token)

Checklist

  • trunk-io/trunk-action@v1 runs on pull_request + push + merge_group
  • TRUNK_TOKEN secret wired in (must be added manually)
  • Android JUnit XML paths configured for Gradle builds
  • iOS XCTest XML paths configured
  • continue-on-error: true on upload steps so test failures don't block CI
  • org-slug: igor-personal matches Trunk dashboard org

@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 1, 2026

Merging to develop in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@gemini-code-assist
Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@github-actions github-actions bot added the pr-state:ci_running Required CI checks are still running label Apr 1, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
3 Security Hotspots

See analysis details on SonarQube Cloud

- name: Upload iOS Test Results
uses: trunk-io/analytics-uploader@main
with:
junit-paths: '**/build/reports/junit/*.xml,**/*.xcresult/**/*.xml'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The iOS test results upload step is misconfigured. It uses junit-paths to look for XML files, but the CI generates binary .xcresult bundles, causing the upload to silently fail.
Severity: MEDIUM

Suggested Fix

Replace the junit-paths parameter with xcresult-path and point it to the .xcresult bundle generated by the test step. This aligns the uploader with the actual artifact being produced, allowing it to process the binary test results directly.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/trunk.yml#L63

Potential issue: The "Upload iOS Test Results" step in the `trunk.yml` workflow is
configured to use the `junit-paths` parameter, which expects JUnit XML files. However,
the CI process generates a binary `.xcresult` bundle. The glob pattern
`**/*.xcresult/**/*.xml` will never match any files because `.xcresult` bundles are a
binary format and do not contain XML files directly. The workflow is missing a
conversion step (e.g., using `xcpretty`) to create JUnit XML. Because
`continue-on-error: true` is enabled, this step will silently fail without uploading any
iOS test data, defeating the purpose of the flaky test detection feature for iOS.

Did we get this right? 👍 / 👎 to inform future reviews.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

CI Some checks failed

Check Result
Android Tests success
iOS Build & Tests success
Python Unit Tests success
Python Script Tests + Release Gate failure
Playwright Local Checks success
Security success

View details

@IgorGanapolsky
Copy link
Copy Markdown
Owner Author

Closing: superseded by later work or has unresolvable merge conflicts. Reopen if still needed.

@IgorGanapolsky IgorGanapolsky deleted the chore/add-trunk-ci branch April 8, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-state:ci_running Required CI checks are still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant