bcgov/Java Unit Test and Analysis with SonarCloud
Run Java unit tests, can analyse with SonarCloud
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Jun 25, 2026
- License
- Apache 2.0
Pinned Snippet
uses: bcgov/action-test-and-analyse-java@a8e35510683d3d916e4366a44b2d5cb61d0f23fe # v.1.2.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| commands | Commands to run tests, start with '|' for multi-line | yes | — |
| dir | App/package directory | yes | — |
| java-version | Java version, defaults to 17 (LTS) | yes | — |
| java-cache | Java package manager cache, defaults to maven | — | maven |
| java-distribution | Java distribution, defaults to temurin | — | temurin |
| sonar_args | SonarCloud command line arguments | — | -Dsonar.organization=bcgov-sonarcloud -Dsonar.projectKey=bcgov_${{ github.repository }} |
| sonar_token | Sonar token, provide unpopulated token for pre-setup (will skip) | — | __OMITTED__ |
| sonar_enforce_compliance | Fail the build if SonarCloud fails. If false, only warn. | — | true |
| triggers | Paths (array) used to trigger a build; e.g. ('./backend/' './frontend/) | — | — |
| diff_branch | Branch to diff against | — | ${{ github.event.repository.default_branch }} |
| repository | Non-default repository to clone (used for testing this action) | — | ${{ github.repository }} |
| branch | Non-default branch to clone (used for testing this action) | — | "" |
Outputs
| name | description |
|---|---|
| triggered | Whether the action was triggered based on path changes |