Note: This file must not be named readme.md as this will lead to it displayed on github as the main readme. Thus: Please keep a different name.
This directory contains GitHub-specific configurations and tools.
This workflow handles our CI/CD pipeline with a focus on code quality, testing, and build verification.
-
Lint
- Uses golangci-lint 2.0.2 for code quality checks
- Runs on all pushes and PRs
- Configuration:
- Uses
.golangci.ymlfor linting rules - Leverages
make lintfor consistent behavior
- Uses
-
Test
- Runs tests and generates coverage reports
- Calculates test-to-code ratio
- Features:
- Generates HTML coverage reports
- Calculates test-to-code ratio
- Shows warnings at 0.7 (70%)
- Targets 1.0 (100%)
- Uploads coverage reports as artifacts
-
Build
- Builds the application
- Runs after successful linting and testing
- Verifies:
- Keytool build
- Server build
- Displays test ratio summary
The workflow has different requirements depending on the context:
-
When Targeting Main:
- All jobs (lint, test, build) must pass
- Test ratio must meet minimum threshold (0.5)
- Acts as a merge gate
- Prevents merging if any check fails
- Applies to:
- Direct pushes to main
- Pull requests targeting main
-
On Feature Branches:
- All jobs run but failures don't block
- Results are reported but not enforced
- Allows pushing regardless of check results
- Encourages good practices without blocking development
A tool to calculate the test-to-code ratio, a standard metric that measures the relative size of test code compared to production code.
- Uses
clocfor accurate code counting - Ignores comments and blank lines
- Provides component-specific ratios
- Shows warnings at 0.7
- Targets 1.0
- Only enforces minimum ratio (0.5) when targeting main
The workflow is automatically triggered on:
- Push to any branch
- Pull request creation/updates
- Manual workflow dispatch
- Linting rules are defined in
.golangci.yml - Build commands are defined in
Makefile - Go version is set to 1.24
- Test ratio thresholds are defined in
scripts/calculate_test_ratio.sh