Skip to content

fix: use correct Docker tag for docker-test job #310

fix: use correct Docker tag for docker-test job

fix: use correct Docker tag for docker-test job #310

Workflow file for this run

name: Go Tests
on:
push:
branches: [main, feature/*, develop]
pull_request:
branches: [main, develop]
jobs:
test:
name: Run Go Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
cache: true
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test -v ./...
- name: Check test coverage
run: |
# Run tests with coverage, excluding main package
go test -coverprofile=coverage.out ./pkg/...
COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | tr -d '%')
echo "Total coverage (excluding main package): $COVERAGE%"
if (( $(echo "$COVERAGE < 55" | bc -l) )); then
echo "Code coverage is below 55%. Please add more tests."
echo "Target coverage goal: 70% (gradually increasing)"
exit 1
fi
echo "✅ Coverage check passed! Current: $COVERAGE%, Target: 70%"
- name: Generate coverage report
run: go tool cover -html=coverage.out -o coverage.html
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.html