Skip to content

chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#13) #14

chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#13)

chore(deps): bump github.com/stretchr/testify from 1.9.0 to 1.10.0 (#13) #14

Workflow file for this run

name: Generate coverage badges
on:
push:
branches: [main]
permissions:
contents: write
jobs:
generate-badges:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# setup go environment
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: coverage
id: coverage
run: |
go test -coverpkg=./... -coverprofile=profile.cov ./...
sed -i '/cmd/d' profile.cov # remove cmd package from coverage
total=$(go tool cover -func profile.cov | grep '^total:' | awk '{print $3}' | sed "s/%//")
rm profile.cov
echo "COVERAGE_VALUE=${total}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
repository: sgaunet/gh-action-test
path: gh-action-test
ref: main
fetch-depth: 1
- name: Generate coverage badge
id: coverage-badge
uses: ./gh-action-test/.github/actions/gh-action-coverage
with:
limit-coverage: "70"
badge-label: "coverage"
badge-filename: "coverage-badge.svg"
badge-value: "${COVERAGE_VALUE}"
- name: Print url of badge
run: |
echo "Badge URL: ${{ steps.coverage-badge.outputs.badge-url }}"