Skip to content

chore: format codebase with gofmt and enforce it in CI #190

chore: format codebase with gofmt and enforce it in CI

chore: format codebase with gofmt and enforce it in CI #190

Workflow file for this run

---
name: "test"
# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- "*"
push:
branches:
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
go-test:
name: go-test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: "go.mod"
- run: go get .
- name: Run tests with coverage
run: go test -v -coverprofile=coverage.out ./internal/...
- name: Write coverage summary
if: always()
run: |
if [ ! -f coverage.out ]; then
echo "coverage.out not produced (test binary likely failed to compile)" >> "$GITHUB_STEP_SUMMARY"
exit 0
fi
total=$(go tool cover -func=coverage.out | tail -1 | awk '{print $NF}')
{
echo "## Test coverage: ${total}"
echo ""
echo '```'
go tool cover -func=coverage.out
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload coverage profile
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-profile
path: coverage.out
retention-days: 7