Update beckn_ci.yml
checking entire directory
This commit is contained in:
11
.github/workflows/beckn_ci.yml
vendored
11
.github/workflows/beckn_ci.yml
vendored
@@ -34,14 +34,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
golangci-lint run ./...
|
golangci-lint run ./...
|
||||||
|
|
||||||
# 5. Run unit tests with coverage recursively for all Go files ${{ env.APP_DIRECTORY }}
|
# 5. Run unit tests with coverage in the entire repository
|
||||||
- name: Run unit tests with coverage
|
- name: Run unit tests with coverage
|
||||||
run: |
|
run: |
|
||||||
# Run tests recursively for all Go files
|
# Find all directories with Go test files and run `go test` on them
|
||||||
go test -v -coverprofile=coverage.out ./...
|
find ./ -type f -name '*_test.go' -exec dirname {} \; | sort -u | while read dir; do
|
||||||
|
echo "Running tests in $dir"
|
||||||
# Generate coverage report
|
go test -v -coverprofile=coverage.out $dir
|
||||||
go tool cover -func=coverage.out | tee coverage.txt
|
go tool cover -func=coverage.out | tee coverage.txt
|
||||||
|
done
|
||||||
|
|
||||||
# 6. Check if coverage is >= 90%, but only check coverage if tests exist
|
# 6. Check if coverage is >= 90%, but only check coverage if tests exist
|
||||||
- name: Check coverage percentage
|
- name: Check coverage percentage
|
||||||
|
|||||||
Reference in New Issue
Block a user