Skip to content

Merge pull request #19 from MimoJanra/dependabot/go_modules/github.co… #130

Merge pull request #19 from MimoJanra/dependabot/go_modules/github.co…

Merge pull request #19 from MimoJanra/dependabot/go_modules/github.co… #130

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
test:
name: Test on Go ${{ matrix.go-version }}
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.25", "1.26"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Run tests
run: go test -v -race -coverprofile=coverage.txt ./...
- name: Check coverage
run: |
coverage=$(go tool cover -func=coverage.txt | grep total | awk '{print $3}' | sed 's/%//')
echo "Coverage: ${coverage}%"
if (( $(echo "$coverage < 75" | bc -l) )); then
echo "Coverage is below 75%"
exit 1
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
flags: unittests
name: codecov-${{ matrix.go-version }}