Skip to content

Commit

Permalink
feat: Add a code coverage badge
Browse files Browse the repository at this point in the history
  • Loading branch information
navasvarela committed Sep 23, 2024
1 parent c872264 commit 4e05fb2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ on:
branches: "**"

permissions:
contents: read
contents: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
Expand All @@ -33,3 +37,30 @@ jobs:
- name: Test with pytest
run: |
pytest
- name: Coverage Badge
uses: tj-actions/coverage-badge-py@v2
if: ${{ github.event_name == 'push' }}

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
if: ${{ github.event_name == 'push' }}
id: verify-changed-files
with:
files: coverage.svg

- name: Commit files
if: steps.verify-changed-files.outputs.files_changed == 'true' && github.event_name == 'push'
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: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true' && github.event_name == 'push'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
force_with_lease: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Documentation Status](https://readthedocs.org/projects/nada-dsl/badge/?version=latest)](https://nada-dsl.readthedocs.io/en/latest/?badge=latest)
![Build Status](https://github.com/NillionNetwork/nada-dsl/actions/workflows/build.yml/badge.svg)
![PyPI - Version](https://img.shields.io/pypi/v/nada-dsl)
![Code coverage](coverage.svg)

# nada-dsl

Expand Down

0 comments on commit 4e05fb2

Please sign in to comment.