style: apply gofmt formatting to all Go files #15
This file contains hidden or 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: Generate coverage badges | |
| on: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate-badges: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # setup go environment | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: 1.25.x | |
| - name: coverage | |
| id: coverage | |
| run: | | |
| go mod download | |
| go test ./... -coverprofile=profile.cov | |
| #echo -n "Total Coverage{{":"}} " | |
| total=$(go tool cover -func profile.cov | grep '^total:' | awk '{print $3}' | sed 's/%//') | |
| rm -f profile.cov | |
| echo "COVERAGE_VALUE=${total}" >> $GITHUB_ENV | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: sgaunet/gh-action-badge | |
| path: gh-action-badge | |
| ref: main | |
| fetch-depth: 1 | |
| - name: Generate coverage badge | |
| id: coverage-badge | |
| uses: ./gh-action-badge/.github/actions/gh-action-coverage | |
| with: | |
| limit-coverage: "30" | |
| 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 }}" |