Bump patch version (#151) #41
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Coverage Badge | |
description: This workflow generates a test coverage badge for the project | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
test-and-generate-coverage-badge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache-dependency-path: go.sum | |
- name: Install dependencies | |
run: go mod download | |
- name: Install ignore coverage tool | |
run: go install github.com/quantumcycle/go-ignore-cov@latest | |
- name: Run script file | |
run: | | |
chmod +x ./scripts/test_coverage_badge.sh | |
./scripts/test_coverage_badge.sh | |
shell: bash | |
- name: Commit Badge to Main Branch | |
run: | | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
if [ -n "$(git status --porcelain)" ]; then | |
git add ./.badges/test_coverage.svg | |
git commit -m "Update coverage badge" | |
git push | |
else | |
echo "No changes to commit or push" | |
fi |