|
| 1 | +# GitHub Workflows Documentation |
| 2 | + |
| 3 | +This project includes several GitHub Actions workflows for continuous integration and security. |
| 4 | + |
| 5 | +## Workflows |
| 6 | + |
| 7 | +### 1. Build and Test (`build.yml`) |
| 8 | + |
| 9 | +**Triggers:** |
| 10 | +- Push to `main` or `develop` branches |
| 11 | +- Pull requests to `main` branch |
| 12 | + |
| 13 | +**Jobs:** |
| 14 | +- **test**: Runs tests on Java 17 and 21 |
| 15 | +- **build**: Builds the application after successful tests |
| 16 | +- **release**: Creates releases on main branch pushes |
| 17 | + |
| 18 | +**Features:** |
| 19 | +- Multi-version Java testing (17, 21) |
| 20 | +- Test result reporting with `dorny/test-reporter` |
| 21 | +- Artifact uploads for build outputs |
| 22 | +- Automated releases with versioning |
| 23 | + |
| 24 | +### 2. CI/CD Pipeline (`ci.yml`) |
| 25 | + |
| 26 | +**Triggers:** |
| 27 | +- Push to `main` or `develop` branches |
| 28 | +- Pull requests to `main` branch |
| 29 | + |
| 30 | +**Jobs:** |
| 31 | +- **test**: Comprehensive testing with matrix strategy |
| 32 | +- **build-and-publish**: Build and release management |
| 33 | +- **security-scan**: OWASP dependency vulnerability scanning |
| 34 | + |
| 35 | +**Features:** |
| 36 | +- Gradle caching for faster builds |
| 37 | +- Test result uploads |
| 38 | +- Security vulnerability reporting |
| 39 | +- Release artifact management |
| 40 | + |
| 41 | +### 3. Static Code Analysis (`static-analysis.yml`) |
| 42 | + |
| 43 | +**Triggers:** |
| 44 | +- Push to `main` or `develop` branches |
| 45 | +- Pull requests to `main` branch |
| 46 | + |
| 47 | +**Jobs:** |
| 48 | +- **static-analysis**: SpotBugs, PMD, and Checkstyle analysis |
| 49 | +- **security-scan**: OWASP dependency vulnerability scanning |
| 50 | + |
| 51 | +**Features:** |
| 52 | +- SpotBugs: Bug pattern detection and code quality |
| 53 | +- PMD: Code style and potential issues |
| 54 | +- Checkstyle: Code formatting and style compliance |
| 55 | +- OWASP dependency scanning for vulnerabilities |
| 56 | +- Detailed reporting and artifact uploads |
| 57 | + |
| 58 | +## Configuration Files |
| 59 | + |
| 60 | +### Dependabot (`dependabot.yml`) |
| 61 | + |
| 62 | +Automatically creates pull requests for: |
| 63 | +- Gradle dependency updates (weekly on Mondays) |
| 64 | +- GitHub Actions updates (weekly on Mondays) |
| 65 | + |
| 66 | +### Pull Request Template |
| 67 | + |
| 68 | +Located at `.github/pull_request_template.md`, provides: |
| 69 | +- Structured PR descriptions |
| 70 | +- Change type categorization |
| 71 | +- Testing checklists |
| 72 | +- Review guidelines |
| 73 | + |
| 74 | +## Security Features |
| 75 | + |
| 76 | +1. **OWASP Dependency Check**: Scans for known vulnerabilities |
| 77 | +2. **SpotBugs Analysis**: Static analysis for bug patterns and code quality |
| 78 | +3. **PMD Analysis**: Code style and potential issue detection |
| 79 | +4. **Checkstyle**: Code formatting and style compliance |
| 80 | +5. **Dependabot**: Automated dependency updates |
| 81 | +6. **JaCoCo Coverage**: Code coverage reporting and verification |
| 82 | + |
| 83 | +## Usage Examples |
| 84 | + |
| 85 | +### Local Development |
| 86 | +```bash |
| 87 | +# Run the same checks as CI |
| 88 | +./gradlew ciBuild |
| 89 | + |
| 90 | +# Run only static analysis |
| 91 | +./gradlew staticAnalysis |
| 92 | + |
| 93 | +# Run security scan |
| 94 | +./gradlew dependencyCheckAnalyze |
| 95 | +open build/reports/dependency-check-report.html |
| 96 | + |
| 97 | +# Run individual static analysis tools |
| 98 | +./gradlew spotbugsMain pmdMain checkstyleMain |
| 99 | +``` |
| 100 | + |
| 101 | +### GitHub Actions |
| 102 | +- All pushes trigger the build pipeline |
| 103 | +- PRs run tests and security scans |
| 104 | +- Main branch pushes create releases |
| 105 | +- Weekly security scans run automatically |
0 commit comments