Skip to content

ci(deps): bump the actions group with 8 updates #582

ci(deps): bump the actions group with 8 updates

ci(deps): bump the actions group with 8 updates #582

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: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
coverage:
name: Test Coverage
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 2 # Required for Codecov to determine PR base SHA
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: 'go.mod'
cache: true
- name: Install scip-go
run: go install github.com/scip-code/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@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v5
with:
files: coverage.out
flags: unit
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage
path: |
coverage.out
coverage.txt
test-output.txt
retention-days: 7