[rocprofiler-compute] added ctest coverage and cdash submission (#366)
* added cdash automatic CI upload * added cdash automatic CI upload * tweaked wording * changed nightly to continuous * removed unnecessary dry-run arg * updated README.md * edited workflow description * update coverage * formatted cmakelists.txt * ruff formatting and update coverage
Bu işleme şunda yer alıyor:
işlemeyi yapan:
GitHub
ebeveyn
bfbb005c42
işleme
f3a2bb07a4
@@ -0,0 +1,89 @@
|
||||
name: rocprofiler-compute CDash Coverage Upload
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ develop ]
|
||||
paths:
|
||||
- 'projects/rocprofiler-compute/coverage/coverage-latest.xml'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
coverage_file:
|
||||
description: 'Path to coverage XML file'
|
||||
required: false
|
||||
default: 'projects/rocprofiler-compute/coverage/coverage-latest.xml'
|
||||
|
||||
concurrency:
|
||||
group: rocprofiler-compute-cdash-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
upload-coverage:
|
||||
runs-on: ubuntu-latest
|
||||
name: Upload Coverage to CDash
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
sparse-checkout: projects/rocprofiler-compute
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Check Coverage File Exists
|
||||
working-directory: projects/rocprofiler-compute
|
||||
run: |
|
||||
COVERAGE_FILE="${{ github.event.inputs.coverage_file || 'coverage/coverage-latest.xml' }}"
|
||||
if [[ "$COVERAGE_FILE" == projects/rocprofiler-compute/* ]]; then
|
||||
COVERAGE_FILE="${COVERAGE_FILE#projects/rocprofiler-compute/}"
|
||||
fi
|
||||
|
||||
if [ ! -f "$COVERAGE_FILE" ]; then
|
||||
echo "ERROR: Coverage file not found at $COVERAGE_FILE!"
|
||||
echo "Please run manual coverage generation"
|
||||
echo "Use: cd projects/rocprofiler-compute && ./utils/update_coverage.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
COVERAGE_INFO=$(python3 -c "
|
||||
import xml.etree.ElementTree as ET
|
||||
try:
|
||||
tree = ET.parse('$COVERAGE_FILE')
|
||||
root = tree.getroot()
|
||||
line_rate = float(root.get('line-rate', 0)) * 100
|
||||
print(f'{line_rate:.1f}%')
|
||||
except Exception as e:
|
||||
print(f'Error parsing coverage: {e}')
|
||||
exit(1)
|
||||
")
|
||||
|
||||
echo "Line Coverage: $COVERAGE_INFO"
|
||||
echo "COVERAGE_INFO=$COVERAGE_INFO" >> $GITHUB_ENV
|
||||
echo "COVERAGE_FILE=$COVERAGE_FILE" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload to CDash
|
||||
working-directory: projects/rocprofiler-compute
|
||||
run: |
|
||||
GIT_SHA_SHORT=$(git rev-parse --short HEAD)
|
||||
BRANCH_NAME=${GITHUB_REF#refs/heads/}
|
||||
|
||||
python3 utils/run-ci.py \
|
||||
--coverage-file "${{ env.COVERAGE_FILE }}" \
|
||||
--build-name "${BRANCH_NAME}-${GIT_SHA_SHORT}-$(date +%Y%m%d)" \
|
||||
--mode "Continuous" \
|
||||
--site "Monorepo-Upload" \
|
||||
--project-name "rocprofiler-compute" \
|
||||
--source-dir "." \
|
||||
--binary-dir "build"
|
||||
|
||||
- name: Summary
|
||||
run: |
|
||||
echo "## CDash Upload Complete!" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Line Coverage**: ${{ env.COVERAGE_INFO }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Commit**: $(git rev-parse --short HEAD)" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **CDash Project**: rocprofiler-compute" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Coverage File**: ${{ env.COVERAGE_FILE }}" >> $GITHUB_STEP_SUMMARY
|
||||
Yeni konuda referans
Bir kullanıcı engelle