From af509f53a113c3b5e3ca4274cb83bf4c3c58ac00 Mon Sep 17 00:00:00 2001 From: "diffblue-cover[bot]" <141632862+diffblue-cover[bot]@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:33:25 +0000 Subject: [PATCH] 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 sales@diffblue.com 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. --- .github/workflows/DiffblueCover.yml | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/DiffblueCover.yml diff --git a/.github/workflows/DiffblueCover.yml b/.github/workflows/DiffblueCover.yml new file mode 100644 index 0000000..6e75f79 --- /dev/null +++ b/.github/workflows/DiffblueCover.yml @@ -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: db-ci-platform@diffblue.com + # Integration test project lives in a subdir + working-directory: ./test/maven-project + # Add a differentiator based on the matrix + topic-id-differentiator: ${{ matrix.os }}