Skip to content

Commit

Permalink
fix: cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
zostay committed Jun 14, 2024
1 parent 8324f3c commit 664a11a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.20
cache: false
- uses: golangci/golangci-lint-action@v6
with:
version: v1.59.0
- run: go test ./...
name: Run All Tests
- run: go test ./... -coverprofile=coverage.out
name: Run Tests with Coverage
version: v1.59
- run: go test -v ./...
- run: |
coveredFiles=$(go list ./... | grep -v 'github.com/zostay/today/\(cmd\|tools/gen/verses\)')
go test $coveredFiles -coverprofile=coverage.out
- run: go tool cover -func=coverage.out
name: Display Coverage
- name: Coverage Quality Check
env:
REQUIRED_COVERAGE: 90
REQUIRED_COVERAGE: 95
run: |
totalCoverage=$(go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+')
echo "Total Coverage: $totalCoverage %"
Expand Down

0 comments on commit 664a11a

Please sign in to comment.