diff --git a/.github/workflows/binary-compatibility.yml b/.github/workflows/binary-compatibility.yml index ee7a01bf08..6d104602da 100644 --- a/.github/workflows/binary-compatibility.yml +++ b/.github/workflows/binary-compatibility.yml @@ -8,6 +8,9 @@ on: paths: - 'assertj-core/**' +env: + MAVEN_ARGS: -B -V -ntp -e -Djansi.passthrough=true -Dstyle.color=always -DskipTests + jobs: verify-with-base: name: Verify with target branch @@ -28,19 +31,12 @@ jobs: ref: ${{ github.base_ref }} path: ${{ github.run_id }}.${{ github.base_ref }} - name: Build `${{ github.base_ref }}` - run: > - ./mvnw -B -V --no-transfer-progress -e -f ${{ github.run_id }}.${{ github.base_ref }}/assertj-core/pom.xml package - -DskipTests - -Djansi.passthrough=true - -Dstyle.color=always + run: ./mvnw $MAVEN_ARGS -f ${{ github.run_id }}.${{ github.base_ref }}/assertj-core/pom.xml package - name: Compare `${{ github.head_ref }}` with `${{ github.base_ref }}` run: > - ./mvnw -B -V --no-transfer-progress -e -f assertj-core/pom.xml -Pjapicmp-branch package japicmp:cmp - -DskipTests + ./mvnw $MAVEN_ARGS -f assertj-core/pom.xml -Pjapicmp-branch package japicmp:cmp -Djapicmp.breakBuildOnBinaryIncompatibleModifications=true -Djapicmp.oldVersion.basedir=${{ github.run_id }}.${{ github.base_ref }}/assertj-core - -Djansi.passthrough=true - -Dstyle.color=always - name: Add label if: failure() @@ -96,11 +92,8 @@ jobs: - name: Compare with the latest release run: > - ./mvnw -B -V --no-transfer-progress -e -f assertj-core/pom.xml package japicmp:cmp - -DskipTests + ./mvnw $MAVEN_ARGS -f assertj-core/pom.xml package japicmp:cmp -Djapicmp.breakBuildOnBinaryIncompatibleModifications=true - -Djansi.passthrough=true - -Dstyle.color=always - name: Add label if: github.base_ref != null && failure() diff --git a/.github/workflows/cross-version.yml b/.github/workflows/cross-version.yml index 326a2d9610..8a1f75e91a 100644 --- a/.github/workflows/cross-version.yml +++ b/.github/workflows/cross-version.yml @@ -2,6 +2,9 @@ name: Cross-Version on: [push, pull_request] +env: + MAVEN_ARGS: -B -V -ntp -e -Djansi.passthrough=true -Dstyle.color=always -Djacoco.skip=true + jobs: test_java: @@ -20,8 +23,4 @@ jobs: release: ${{ matrix.java }} version: latest - name: Test - run: > - ./mvnw -B -V --no-transfer-progress -e verify javadoc:javadoc - -Djacoco.skip=true - -Djansi.passthrough=true - -Dstyle.color=always + run: ./mvnw $MAVEN_ARGS verify javadoc:javadoc diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89a6a7414d..a70f390d15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,24 +2,17 @@ name: CI on: [push, pull_request] +env: + MAVEN_ARGS: -B -V -ntp -e -Djansi.passthrough=true -Dstyle.color=always + jobs: test_os: name: OS ${{ matrix.os }} - permissions: - # Needed for test reporting - checks: write - pull-requests: write strategy: fail-fast: false matrix: - include: - - os: ubuntu-latest - comment-test-results: true - - os: macOS-latest - comment-test-results: false - - os: windows-latest - comment-test-results: false + os: [ubuntu-latest, macOS-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -30,20 +23,7 @@ jobs: java-version: 17 cache: 'maven' - name: Test - # Note: arguments with a period or bang in them have to be single quoted to prevent - # confusing the PowerShell instance on Windows runners. - run: > - ./mvnw -B -V --no-transfer-progress -e verify javadoc:javadoc - '-Djansi.passthrough=true' - '-Dstyle.color=always' - - - name: Publish unit test results - uses: EnricoMi/publish-unit-test-result-action@v2 - if: ${{ matrix.comment-test-results }} - continue-on-error: true - with: - check_name: "JUnit test results" - junit_files: "assertj*/**/target/surefire-reports/TEST-*.xml" + run: ./mvnw $MAVEN_ARGS verify javadoc:javadoc sonar: name: Sonar code analysis @@ -62,12 +42,10 @@ jobs: cache: 'maven' - name: Test with Sonar run: > - ./mvnw -B -V --no-transfer-progress -e verify javadoc:javadoc sonar:sonar + ./mvnw $MAVEN_ARGS verify javadoc:javadoc sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=assertj -Dsonar.projectKey=joel-costigliola_assertj-core - -Djansi.passthrough=true - -Dstyle.color=always env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/pitest-receive-pr.yml b/.github/workflows/pitest-receive-pr.yml index f71e6348a6..4449e6e67d 100644 --- a/.github/workflows/pitest-receive-pr.yml +++ b/.github/workflows/pitest-receive-pr.yml @@ -15,6 +15,9 @@ name: Receive on: pull_request: +env: + MAVEN_ARGS: -B -V -ntp -e -Djansi.passthrough=true -Dstyle.color=always + jobs: store-pitest-feedback: # Only run on forked repos. @@ -39,14 +42,10 @@ jobs: # we add config to analyse only changes made within a PR and treat surviving mutants as check errors # failWhenNoMutations is unset in the pom, as otherwise PRs that do not affect java code would fail run: > - mvn -B -e -Ppitest -Dfeatures="+GIT(from[HEAD~1]), +gitci" test - -Djansi.passthrough=true - -Dstyle.color=always + ./mvnw $MAVEN_ARGS -Ppitest -Dfeatures="+GIT(from[HEAD~1]), +gitci" test - name: aggregate files run: > - mvn -B -e -f assertj-core/pom.xml -Ppitest pitest-git:aggregate - -Djansi.passthrough=true - -Dstyle.color=always + ./mvnw $MAVEN_ARGS -f assertj-core/pom.xml -Ppitest pitest-git:aggregate - name: upload results uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/pitest-updated-pr.yml b/.github/workflows/pitest-updated-pr.yml index 41ab2755aa..5b38013af3 100644 --- a/.github/workflows/pitest-updated-pr.yml +++ b/.github/workflows/pitest-updated-pr.yml @@ -19,6 +19,9 @@ on: types: - completed +env: + MAVEN_ARGS: -B -V -ntp -e -Djansi.passthrough=true -Dstyle.color=always + jobs: pitest-update-pr: if: ${{ github.event.workflow_run.conclusion == 'success' }} @@ -43,6 +46,4 @@ jobs: # the code, but does mean the version here must be maintained. An alternative would be to checkout the code and use # the github goal. This will work as long as the artifact is extracted to the maven target directory run: > - mvn -B -DrepoToken=${{ secrets.GITHUB_TOKEN }} com.groupcdg:pitest-github-maven-plugin:1.0.8:updatePR - -Djansi.passthrough=true - -Dstyle.color=always + ./mvnw $MAVEN_ARGS -DrepoToken=${{ secrets.GITHUB_TOKEN }} com.groupcdg:pitest-github-maven-plugin:1.0.8:updatePR diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e90afd4b5..354131dfd4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,9 @@ name: Release on: workflow_dispatch: +env: + MAVEN_ARGS: -B -V -ntp -e -Djansi.passthrough=true -Dstyle.color=always -Djacoco.skip=true + jobs: release: @@ -25,9 +28,7 @@ jobs: run: | git config user.name '${{ github.actor }}' git config user.email '${{ github.actor }}@users.noreply.github.com' - ./mvnw -B release:prepare release:perform -Dpassword=${{ secrets.GITHUB_TOKEN }} \ - -Djansi.passthrough=true \ - -Dstyle.color=always + ./mvnw $MAVEN_ARGS release:prepare release:perform -Dpassword=${{ secrets.GITHUB_TOKEN }} env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}