Skip to content

Commit

Permalink
Configuring Diffblue Cover
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
diffblue-cover[bot] authored Aug 18, 2023
1 parent 16a9ad9 commit 271f3b2
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/DiffblueCover.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Diffblue Cover

on:
pull_request:

jobs:
Diffblue:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3
with:
# The default GITHUB_TOKEN doesn't have the necessary permissions
# so a custom token should be used here with sufficient access.
token: ${{ secrets.DIFFBLUE_TOKEN }}

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'

- name: Maven Install
run: mvn --batch-mode install

- name: Diffblue Cover
uses: diffblue/cover-github-action@main
env:
GITHUB_TOKEN: ${{ secrets.DIFFBLUE_TOKEN }}
JVM_ARGS: -Xmx4096m
with:
# License key used to activate the installation
license-key: ${{ secrets.DIFFBLUE_LICENSE_KEY }}
# User name and email used to author commits
user-name: Diffblue CI
user-email: [email protected]
# Integration test project lives in a subdir
working-directory: ./test/maven-project
# Add a differentiator based on the matrix
topic-id-differentiator: ${{ matrix.os }}

0 comments on commit 271f3b2

Please sign in to comment.