Skip to content

ci(deps): bump the actions group across 1 directory with 10 updates #342

ci(deps): bump the actions group across 1 directory with 10 updates

ci(deps): bump the actions group across 1 directory with 10 updates #342

Workflow file for this run

name: Coverage
on:
workflow_dispatch:
push:
branches: [main, develop]
pull_request:
branches: [develop, main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
coverage:
name: Test Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 2 # Required for Codecov to determine PR base SHA
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- name: Install scip-go
run: go install github.com/sourcegraph/scip-go/cmd/scip-go@latest
- name: Run tests with coverage
run: |
go test -v -race -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./... 2>&1 | tee test-output.txt
COVERAGE="N/A"
if [ -f coverage.out ]; then
go tool cover -func=coverage.out -o coverage.txt
COVERAGE=$(grep "^total:" coverage.txt | awk '{print $3}' | sed 's/%//')
else
: > coverage.txt
fi
# Job summary
echo "### ✅ Tests | ${COVERAGE}% Coverage" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Coverage threshold enforced by [Codecov](https://app.codecov.io/gh/${{ github.repository }})." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "<details>" >> $GITHUB_STEP_SUMMARY
echo "<summary>Coverage by package</summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
head -50 coverage.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
- name: Upload to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.out
flags: unit
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage
if: always()
uses: actions/upload-artifact@v6
with:
name: coverage
path: |
coverage.out
coverage.txt
test-output.txt
retention-days: 7