diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13c13eb..855d69a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,7 +31,7 @@ jobs: workflow_conclusion: success name: main.breakdown if_no_artifact_found: warn - - name: Ensure default.breakdown exists if download fails + - name: Create main.breakdown If Not Exist run: | if [ ! -f main.breakdown ]; then echo "main.breakdown not found. Creating an empty main.breakdown file." @@ -45,7 +45,7 @@ jobs: with: config: ./.testcoverage.yml breakdown-file-name: ${{ github.ref_name == 'main' && 'main.breakdown' || '' }} - diff-base-breakdown-file-name: ${{ steps.download-main-breakdown.outputs.found_artifact && 'main.breakdown' || 'main.breakdown' }} + diff-base-breakdown-file-name: 'main.breakdown' - name: Upload Artifact (main.breakdown) uses: actions/upload-artifact@v4 if: github.ref_name == 'main' @@ -60,7 +60,7 @@ jobs: with: issue-number: ${{ github.event.pull_request.number }} comment-author: 'github-actions[bot]' - body-includes: 'go-test-coverage report:' + body-includes: '๐Ÿ“Š Coverage Report' - name: Send Coverage Report if: ${{ github.event.pull_request.number != null }} uses: peter-evans/create-or-update-comment@v4 @@ -75,9 +75,7 @@ jobs:
Click to see detailed coverage report - ``` ${{ steps.coverage.outputs.report }} - ```
diff --git a/.testcoverage.yml b/.testcoverage.yml index 1b439f0..2b2573a 100644 --- a/.testcoverage.yml +++ b/.testcoverage.yml @@ -17,6 +17,14 @@ threshold: # Minimum overall project coverage percentage required. total: 75 + # (optional; default 0) + # Minimum coverage percentage required for individual files. + file: 70 + + # (optional; default 0) + # Minimum coverage percentage required for each package. + package: 70 + # Holds regexp rules which will exclude matched files or packages # from coverage statistics. exclude: @@ -26,24 +34,6 @@ exclude: - "examples/" - "mock/" -# ่ฎพ็ฝฎๆ€ปไฝ“่ฆ†็›–็Ž‡่ฆๆฑ‚ -total: - statements: 75 - -# ๆŒ‰ๅŒ…็ปŸ่ฎก่ฆ†็›–็Ž‡ -by-package: - # ๆฏไธชๅŒ…็š„ๆœ€ไฝŽ่ฆ†็›–็Ž‡่ฆๆฑ‚ - threshold: 60 - # ๅฑ•็คบๆ‰€ๆœ‰ๅŒ…็š„่ฆ†็›–็Ž‡๏ผŒ่€Œไธๆ˜ฏๅชๅฑ•็คบๆœช่พพๆ ‡็š„ๅŒ… - show-all: true - -# ๆŒ‰ๆ–‡ไปถ็ปŸ่ฎก่ฆ†็›–็Ž‡ -by-file: - # ๆฏไธชๆ–‡ไปถ็š„ๆœ€ไฝŽ่ฆ†็›–็Ž‡่ฆๆฑ‚ - threshold: 50 - # ๅฑ•็คบๆ‰€ๆœ‰ๆ–‡ไปถ็š„่ฆ†็›–็Ž‡ - show-all: true - # ๅขž้‡่ฆ†็›–็Ž‡้…็ฝฎ diff: # ๆ–ฐๅขžไปฃ็ ็š„ๆœ€ไฝŽ่ฆ†็›–็Ž‡่ฆๆฑ‚