@@ -275,45 +275,45 @@ jobs:
275275 name : submodule-coverage-reports
276276 path : coverage_reports/*.cov
277277
278- # Job for uploading coverage to external services (CodeClimate )
279- # upload_coverage:
280- # name: Upload Coverage📊
281- # runs-on: ubuntu-latest
282- # # This job only needs example and pkg test results, not submodules
283- # needs: [Example-Unit-Testing, PKG-Unit-Testing]
284- # # Only run this job on pushes to the development branch
285- # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
286- # steps:
287- # - name: Check out code into the Go module directory
288- # uses: actions/checkout@v5
289- #
290- # # Download coverage artifacts
291- # - name: Download Coverage Report
292- # uses: actions/download-artifact@v5
293- # with:
294- # path: artifacts
295- #
296- # # Merge coverage from example and pkg tests only
297- # - name: Merge Coverage Files
298- # working-directory: artifacts
299- # run: |
300- # echo "mode: set" > merged_profile.cov
301- # tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
302- # tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
303- #
304- # # Generate and print total coverage percentage
305- # echo "Total Coverage:"
306- # go tool cover -func=merged_profile.cov | tail -n 1
307- # shell: bash
308- #
309- # # Upload merged coverage to CodeClimate for analysis
310- # - name: Upload
311- # uses: paambaati/[email protected] 312- # env:
313- # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
314- # with:
315- # coverageLocations: artifacts/merged_profile.cov:gocov
316- # prefix: gofr.dev
278+ # Job for uploading coverage to external services (qlty.sh )
279+ upload_coverage :
280+ name : Upload Coverage📊
281+ runs-on : ubuntu-latest
282+ # This job only needs example and pkg test results, not submodules
283+ needs : [Example-Unit-Testing, PKG-Unit-Testing]
284+ # Only run this job on pushes to the development branch
285+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
286+ steps :
287+ - name : Check out code into the Go module directory
288+ uses : actions/checkout@v5
289+
290+ - name : Install qlty CLI
291+ run : curl -s https://qlty.sh/install | bash
292+
293+ # Download coverage artifacts
294+ - name : Download Coverage Report
295+ uses : actions/download-artifact@v5
296+ with :
297+ path : artifacts
298+
299+ # Merge coverage from example and pkg tests only
300+ - name : Merge Coverage Files
301+ working-directory : artifacts
302+ run : |
303+ echo "mode: set" > merged_profile.cov
304+ tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
305+ tail -n +2 ./PKG- Coverage-Report/profile.cov >> merged_profile.cov
306+
307+ # Generate and print total coverage percentage
308+ echo "Total Coverage:"
309+ go tool cover -func=merged_profile.cov | tail -n 1
310+ shell : bash
311+
312+ # Upload merged coverage to CodeClimate for analysis
313+ - name : Upload
314+ run : qlty coverage publish --input merged_profile.cov
315+ env :
316+ QLTY_TOKEN : ${{ secrets.QLTY_TOKEN }}
317317
318318 # Job for code quality checks
319319 code_quality :
0 commit comments