Skip to content

no-jira: fix coverage pull request step #466

no-jira: fix coverage pull request step

no-jira: fix coverage pull request step #466

# This workflow will generate and push an updated coverage badge
name: Coverage Badge
on:
push:
branches: [ main, ray-jobs-feature ]
jobs:
report:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry lock
poetry install --with test
- name: Generate coverage report
run: |
coverage run --omit="src/**/test_*.py,src/codeflare_sdk/common/utils/unit_test_support.py" -m pytest
- name: Coverage Badge
uses: tj-actions/coverage-badge-py@v2
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v18
id: changed_files
with:
files: coverage.svg
- name: Commit files
if: steps.changed_files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add coverage.svg
git commit -m "Updated coverage.svg"
- name: Create Pull Request
if: steps.changed_files.outputs.files_changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "[Automatic] Coverage Badge Update"
commit-message: "Updated coverage.svg"
branch: create-pull-request/coverage-badge-update
delete-branch: true
body: |
This is an automated pull request to update the coverage badge.
- Updated coverage.svg based on latest test results