Skip to content

Commit af509f5

Browse files
Configuring Diffblue Cover
Added a GitHub Actions workflow `.github/workflows/DiffblueCover.yml` invoking Diffblue Cover on each pull request. This default workflow configuration should be sufficient for single module Maven projects, but will need further customization for more complex projects. ## Next steps - [ ] Obtain a license activation code. - Contact [email protected] if you don't already have one. - [ ] Obtain a GitHub access token used to interact with GitHub APIs and start workflows. - Use https://github.com/settings/tokens/new to generate a token with full `repo` access. - [ ] Configure repository secrets: - Use https://github.com/{owner}/{repo}/settings/secrets/actions - Create a `DIFFBLUE_LICENSE_KEY` secret containing your license activation code. - Create a `DIFFBLUE_TOKEN` secret containing your access token. - [ ] Ensure that the project is correctly built before Diffblue Cover is invoked. - [ ] Assuming you made changes above, then navigate to the latest action and click "Re-run all jobs" - [ ] Enjoy some AI generated unit tests! See [Customizing GitHub Actions](https://docs.diffblue.com/customizing-github-actions) for ideas on further customization.
1 parent 16a9ad9 commit af509f5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/DiffblueCover.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Diffblue Cover
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
Diffblue:
8+
runs-on: ubuntu-latest
9+
steps:
10+
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
# The default GITHUB_TOKEN doesn't have the necessary permissions
15+
# so a custom token should be used here with sufficient access.
16+
token: ${{ secrets.DIFFBLUE_TOKEN }}
17+
18+
- name: Setup Java
19+
uses: actions/setup-java@v3
20+
with:
21+
java-version: '8'
22+
distribution: 'zulu'
23+
24+
- name: Maven Install
25+
run: mvn --batch-mode install
26+
27+
- name: Diffblue Cover
28+
uses: diffblue/cover-github-action@main
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.DIFFBLUE_TOKEN }}
31+
JVM_ARGS: -Xmx4096m
32+
with:
33+
# License key used to activate the installation
34+
license-key: ${{ secrets.DIFFBLUE_LICENSE_KEY }}
35+
# User name and email used to author commits
36+
user-name: Diffblue CI
37+
user-email: [email protected]
38+
# Integration test project lives in a subdir
39+
working-directory: ./test/maven-project
40+
# Add a differentiator based on the matrix
41+
topic-id-differentiator: ${{ matrix.os }}

0 commit comments

Comments
 (0)