Skip to content

chore: add test coverage #5

chore: add test coverage

chore: add test coverage #5

name: Coverage Report
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
workflow:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- uses: extractions/setup-just@v1
- name: Install dependencies
run: go mod download
- name: Test
run: just test-ci
- name: Go Coverage Badge
uses: tj-actions/coverage-badge-go@v2
with:
filename: coverage.out
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v16
id: verify-changed-files
with:
files: README.md
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "chore: Updated coverage badge."
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}