1212 - development
1313 paths-ignore :
1414 - ' docs/**' # Ignore changes to docs folder
15+ - ' **/*.md'
1516 # Run on pull requests to main or development branches
1617 pull_request :
1718 branches :
1819 - main
1920 - development
2021 paths-ignore :
21- - ' docs/**' # Ignore changes to docs folder
22+ - ' docs/**' # Ignore changes to docs folder
23+ - ' **/*.md'
2224
2325# Define the jobs that this workflow will run
2426jobs :
@@ -29,15 +31,15 @@ jobs:
2931 # Define a matrix strategy to test against multiple Go versions
3032 strategy :
3133 matrix :
32- go-version : ['1.24 ','1.23 ', '1.22 ']
34+ go-version : ['1.25 ','1.24 ', '1.23 ']
3335 # Continue with other jobs if one version fails
3436 fail-fast : false
3537
3638 # Define service containers that tests depend on
3739 services :
3840 # Kafka service
3941 kafka :
40- image : bitnami/kafka:3.4
42+ image : bitnami/kafka:3.4.1
4143 ports :
4244 - " 9092:9092"
4345 env :
@@ -120,7 +122,7 @@ jobs:
120122 runs-on : ubuntu-latest
121123 strategy :
122124 matrix :
123- go-version : ['1.24 ','1.23 ', '1.22 ']
125+ go-version : ['1.25 ','1.24 ', '1.23 ']
124126 fail-fast : false
125127
126128 steps :
@@ -146,15 +148,39 @@ jobs:
146148 with :
147149 timeout_minutes : 5
148150 max_attempts : 2
151+ retry_on : error
149152 command : |
150153 export APP_ENV=test
151- # Run tests with coverage for root gofr package only
152- go test -v -short -covermode=atomic -coverpkg=./pkg/gofr -coverprofile=gofr_only.cov ./pkg/gofr
153- # Run tests for all sub-packages under gofr
154- go test -v -covermode=atomic -coverpkg=./pkg/gofr -coverprofile=submodules.cov ./pkg/gofr/...
154+
155+ # Run tests for root gofr package
156+ go test -v -short -covermode=atomic \
157+ -coverpkg=./pkg/gofr -coverprofile=gofr_only.cov ./pkg/gofr
158+ exit_code=$?
159+ if [ $exit_code -eq 2 ]; then
160+ echo "::error::Panic detected in root gofr package tests"
161+ exit 2
162+ elif [ $exit_code -ne 0 ]; then
163+ echo "::error::Root gofr package tests failed"
164+ exit $exit_code
165+ fi
166+
167+ # Run tests for sub-packages
168+ go test -v -covermode=atomic \
169+ -coverpkg=./pkg/gofr -coverprofile=submodules.cov ./pkg/gofr/...
170+ exit_code=$?
171+ if [ $exit_code -eq 2 ]; then
172+ echo "::error::Panic detected in gofr sub-packages tests"
173+ exit 2
174+ elif [ $exit_code -ne 0 ]; then
175+ echo "::error::Gofr sub-packages tests failed"
176+ exit $exit_code
177+ fi
178+
155179 # Combine coverage profiles
156180 echo "mode: atomic" > profile.cov
157181 grep -h -v "mode:" gofr_only.cov submodules.cov | grep -v '/mock_' >> profile.cov
182+
183+ # Show coverage summary
158184 go tool cover -func profile.cov
159185
160186 # Upload coverage report for the 1.24 Go version only
@@ -208,7 +234,7 @@ jobs:
208234 runs-on : ubuntu-latest
209235 strategy :
210236 matrix :
211- go-version : ['1.24 ','1.23 ', '1.22 ']
237+ go-version : ['1.25 ','1.24 ', '1.23 ']
212238 fail-fast : false
213239
214240 steps :
@@ -264,7 +290,7 @@ jobs:
264290
265291 # Copy coverage file to the coverage_reports directory
266292 cp ${module_name}.cov ../../../coverage_reports/
267-
293+
268294 cd -
269295 '
270296
@@ -275,45 +301,52 @@ jobs:
275301 name : submodule-coverage-reports
276302 path : coverage_reports/*.cov
277303
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
304+ # Job for uploading coverage to external services (qlty.sh)
305+ upload_coverage :
306+ name : Upload Coverage📊
307+ runs-on : ubuntu-latest
308+ env :
309+ QLTY_TOKEN : ${{ secrets.QLTY_TOKEN }}
310+ QLTY_COVERAGE_TOKEN : ${{ secrets.QLTY_TOKEN }}
311+
312+ # This job only needs example and pkg test results, not submodules
313+ needs : [Example-Unit-Testing, PKG-Unit-Testing]
314+ # Only run this job on pushes to the development branch
315+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
316+ steps :
317+ - name : Check out code into the Go module directory
318+ uses : actions/checkout@v5
319+
320+ - name : Install qlty CLI
321+ run : |
322+ curl https://qlty.sh | sh
323+ echo "$HOME/.qlty/bin" >> $GITHUB_PATH
324+
325+ # Download coverage artifacts
326+ - name : Download Coverage Report
327+ uses : actions/download-artifact@v5
328+ with :
329+ path : artifacts
330+
331+ # Merge coverage from example and pkg tests only
332+ - name : Merge Coverage Files
333+ working-directory : artifacts
334+ run : |
335+ echo "mode: set" > merged_profile.cov
336+ tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
337+ tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
338+
339+ # Generate and print total coverage percentage
340+ echo "Total Coverage:"
341+ go tool cover -func=merged_profile.cov | tail -n 1
342+ shell : bash
343+
344+ # Upload merged coverage to CodeClimate for analysis
345+ - name : Upload
346+ working-directory : artifacts
347+ run : qlty coverage publish merged_profile.cov --format=coverprofile --strip-prefix="gofr.dev/" --add-prefix="${GITHUB_WORKSPACE}/"
348+ env :
349+ QLTY_TOKEN : ${{ secrets.QLTY_TOKEN }}
317350
318351 # Job for code quality checks
319352 code_quality :
@@ -326,13 +359,13 @@ jobs:
326359 - name : Set up Go environment
327360 uses : actions/setup-go@v5
328361 with :
329- go-version : ' 1.24 '
362+ go-version : ' 1.25 '
330363 cache : false
331364
332365 # Install the linting tool
333366 - name : Install golangci-lint
334367 run : |
335- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1
368+ go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0
336369
337370 - name : Get dependencies
338371 run : |
@@ -373,7 +406,7 @@ jobs:
373406 - name : Set up Go environment
374407 uses : actions/setup-go@v5
375408 with :
376- go-version : 1.24
409+ go-version : 1.25
377410
378411 # Check file naming conventions using ls-lint
379412 - name : Check for file names errors
0 commit comments