Files
TheRock/rocm-systems/.github/workflows/rdc-dme-sync-check.yml
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

84 lines
2.8 KiB
YAML

name: RDC-DME Metric Sync Check
on:
schedule:
- cron: '23 9 * * 1' # Weekly on Monday at 9:23 UTC
workflow_dispatch:
pull_request:
paths:
- 'projects/rdc/include/rdc/rdc.h'
- 'projects/rdc/tools/dme_rdc_metric_mapping.json'
- 'projects/rdc/tools/dme_rdc_metric_sync_check.py'
jobs:
sync-check:
runs-on: ubuntu-latest
steps:
- name: Checkout rocm-systems
uses: actions/checkout@v4
with:
sparse-checkout: |
projects/rdc/include/rdc/rdc.h
projects/rdc/tools/
sparse-checkout-cone-mode: false
- name: Checkout device-metrics-exporter
uses: actions/checkout@v4
with:
repository: ROCm/device-metrics-exporter
path: dme-upstream
sparse-checkout: |
pkg/
internal/
cmd/
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Run sync check
id: sync-check
run: |
python3 projects/rdc/tools/dme_rdc_metric_sync_check.py \
--rdc-header projects/rdc/include/rdc/rdc.h \
--mapping projects/rdc/tools/dme_rdc_metric_mapping.json \
--dme-path dme-upstream \
--output sync-report.json
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: dme-rdc-sync-report
path: sync-report.json
- name: Create issue on failure
if: failure() && github.event_name == 'schedule'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const report = JSON.parse(fs.readFileSync('sync-report.json', 'utf8'));
const unmapped = report.unmapped_dme_metrics || [];
const stale = report.stale_mappings || [];
let body = '## DME-RDC Metric Sync Gap Detected\n\n';
body += `RDC fields: ${report.rdc_field_count}\n`;
body += `Mapped: ${report.mapped}, Skipped: ${report.skipped}\n\n`;
if (unmapped.length > 0) {
body += '### New Unmapped DME Metrics\n\n';
unmapped.forEach(m => { body += `- \`${m}\`\n`; });
}
if (stale.length > 0) {
body += '\n### Stale Mappings\n\n';
stale.forEach(s => { body += `- \`${s.dme}\` -> \`${s.rdc}\`: ${s.issue}\n`; });
}
body += '\n---\nGenerated by RDC-DME Sync Check workflow.';
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: '[RDC] DME metric sync gap detected',
body: body,
labels: ['rdc', 'metrics']
});