Template repo used to create other single-module repos.
The template sets up the following:
- Single-module Gradle Java project, including:
- Code formatting by Spotless
- Static code analysis by Spotbugs and Checkstyle
- Release versioning by the Axion-release-plugin
- Code coverage analysis by Jacoco
- Code coverage tracking by Coveralls.io
- Default set of test dependencies:
- GitHub build workflow, including:
- Gradle build
- Coveralls.io reporting
- Release versioning
- GitHub code owners and PR template.
- Click the "Use this template" button on the main page and follow the instructions.
- Import the new repo into Coveralls.io, noting the repo token.
- Customise the repo in GitHub
Settings
->:Options
->Merge Button
:- un-tick:
Allow merge commits
andAllow rebase merging
. - tick:
Allow auto-merging
andAutomatically delete head branches
- un-tick:
Collaborators and teams
->Manage access
: addcode-reviews
team with theWrite
role.
Secrets
->:Actions
-> Add a new repository secret calledCOVERALLS_REPO_TOKEN
, grabbing the value from Coveralls.io.,Dependabot
-> Add the sameCOVERALLS_REPO_TOKEN
repository secret here too
- Customise the files in the new repo:
- Replace the
single-module-template
repo name with the name of the new project. Each place is marked with aChangeMe
comment. - Replace the example api with some initial code.
- Replace the
creek.template.module.single
module name with a suitable module name. Each place is marked with aChangeMe
comment. - Replace this README.md
- Commit changes as a PR (so you can test the PR build works!)
- Replace the
- Finish customising the repo in GitHub
Settings
->Branches
and protect themain
branch:- Tick
Require a pull request before merging
- With
Require approvals
set to 1.
- With
- Tick
Require statuc checks to pass before merging
- With
Require branches to be up to date before merging
- With status checks:
build
codeQL
coverage/coveralls
- With
- Tick
- Finish customising the repo in Coveralls.io
Settings
->Pull Request Alerts
:- Tick
Leave comments
- Set
COVERAGE THRESHOLD FOR FAILURE
to80
% - Set
COVERAGE DECREASE THRESHOLD FOR FAILURE
to1
% - Save changes.
- Tick
- Use the "Set next version" GitHub workflow to set the next version inline with other Creek repos.
./gradlew format
will format the code using Spotless../gradlew static
will run static code analysis, i.e. Spotbugs and Checkstyle../gradlew check
will run all checks and tests../gradlew coverage
will generate a Jacoco coverage report../gradlew
will run the default tasks offormat
,static
andcheck
.