Skip to content

CI: make ATOM test workflow reusable#554

Open
gyohuangxin wants to merge 2 commits intomainfrom
ci/atom-test-reusable-workflow
Open

CI: make ATOM test workflow reusable#554
gyohuangxin wants to merge 2 commits intomainfrom
ci/atom-test-reusable-workflow

Conversation

@gyohuangxin
Copy link
Copy Markdown
Member

Summary

  • split atom-test.yaml into a reusable workflow_call entrypoint plus a lightweight trigger wrapper
  • parameterize checkout, repo/ref, fork handling, model scope, and dashboard publishing so other repos can call the same ATOM test pipeline
  • keep the existing push / pull_request / schedule / workflow_dispatch entrypoints via atom-test-trigger.yaml

Test plan

  • Checked workflow YAML with editor diagnostics (ReadLints)
  • Trigger the new wrapper workflow in ROCm/ATOM
  • Invoke the reusable workflow from an external test workflow
  • Verify pre-checkin signal lookup still works with the passed ATOM commit SHA
  • Verify dashboard publishing still only runs from the wrapper on main push/schedule

Split the ATOM test workflow into a reusable workflow_call entrypoint and a local trigger wrapper so other repos can invoke the same test pipeline.
Copilot AI review requested due to automatic review settings April 14, 2026 03:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the existing ATOM CI test pipeline into a reusable workflow_call workflow and introduces a lightweight trigger wrapper to preserve the current push / pull_request / schedule / workflow_dispatch entrypoints while enabling cross-repo reuse.

Changes:

  • Converted .github/workflows/atom-test.yaml into a reusable workflow with workflow_call inputs/secrets for checkout source, fork handling, model scope selection, pre-check gating, and dashboard publishing.
  • Added .github/workflows/atom-test-trigger.yaml as the wrapper workflow that maps repository events to the reusable workflow inputs and secrets.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/atom-test.yaml Reworked into a reusable workflow with parameterized checkout/source SHA, optional pre-check gating, and optional dashboard publishing.
.github/workflows/atom-test-trigger.yaml New wrapper workflow that preserves existing triggers and calls the reusable workflow with computed inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

GITHUB_SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ secrets.github_token || github.token }}
GITHUB_REPOSITORY: ${{ inputs.checkout_repository }}
GITHUB_SHA: ${{ env.GITHUB_COMMIT_SHA }}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

Pre-checkin signal artifacts are published as checks-signal-${{ github.sha }} by pre-checks.yaml, i.e. keyed to the workflow run SHA (merge SHA for PRs). This job now sets GITHUB_SHA to env.GITHUB_COMMIT_SHA (which resolves to the PR head SHA via source_commit_sha), so check_signal.sh will look for a non-existent artifact on PRs and always time out. Use the checked-out ref/SHA (inputs.checkout_ref, which the trigger sets to github.sha) for the signal lookup, or introduce a dedicated signal_commit_sha input to avoid conflating the two SHAs.

Suggested change
GITHUB_SHA: ${{ env.GITHUB_COMMIT_SHA }}
GITHUB_SHA: ${{ inputs.checkout_ref }}

Copilot uses AI. Check for mistakes.
needs: [atom-test]
if: always() && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'schedule')
if: ${{ always() && inputs.publish_dashboard }}
runs-on: ubuntu-latest
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

publish_dashboard can cause this job to push to gh-pages, but accuracy-dashboard does not declare permissions: contents: write (and likely actions: read for artifact download). In reusable workflows, callers often set the default GITHUB_TOKEN permissions to read-only, which will make the dashboard publish fail even when publish_dashboard is true. Add an explicit permissions block on this job (or document/require the caller to grant these permissions) so reuse is reliable.

Suggested change
runs-on: ubuntu-latest
runs-on: ubuntu-latest
permissions:
contents: write
actions: read

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +70
GITHUB_REPO_URL: ${{ inputs.source_repo_url || format('https://github.com/{0}.git', inputs.checkout_repository) }}
GITHUB_COMMIT_SHA: ${{ inputs.source_commit_sha || inputs.checkout_ref }}
AITER_GIT_REF: ${{ inputs.aiter_branch }}
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

The new run_precheck / source_commit_sha inputs allow callers to enable the pre-checkin gate, but GITHUB_COMMIT_SHA currently falls back to inputs.checkout_ref (which may be a branch/ref string). Since the pre-checkin artifact naming is SHA-based (checks-signal-<sha>), enabling run_precheck with a non-SHA checkout_ref will deterministically fail after retries. Consider validating that the commit input is a full SHA (or resolve the checked-out ref to a SHA via git rev-parse) before running the signal download to fail fast with a clear error.

Copilot uses AI. Check for mistakes.
Resolve the reusable workflow conflict against the latest ATOM test changes and keep the new main-branch concurrency behavior in the trigger wrapper.
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.

2 participants