diff --git a/.github/workflows/pr-tests.yml b/.github/workflows/pr-tests.yml index 4e87e89..f18cee9 100644 --- a/.github/workflows/pr-tests.yml +++ b/.github/workflows/pr-tests.yml @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: true jobs: - test: + build: if: ${{ github.event.pull_request.draft == false }} runs-on: ubuntu-latest @@ -31,12 +31,109 @@ jobs: java-version: "21" cache: maven - - name: Run Maven test with NullAway - run: ./mvnw -B -ntp -Pnullaway test + - name: Set Maven wrapper permissions + run: chmod +x mvnw - crap-java: - name: crap-java Gate + - name: Build + run: ./mvnw -B -ntp -P!quality-gates-all,nullaway -DskipTests install + + - name: Upload Maven repository + uses: actions/upload-artifact@v7 + with: + name: maven-repository + path: /home/runner/.m2/repository + if-no-files-found: error + + - name: Upload build outputs + uses: actions/upload-artifact@v7 + with: + name: build-target + path: target + if-no-files-found: error + + test-unit: + name: test / unit if: ${{ github.event.pull_request.draft == false }} + needs: + - build + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: "21" + + - name: Set Maven wrapper permissions + run: chmod +x mvnw + + - name: Download Maven repository + uses: actions/download-artifact@v8 + with: + name: maven-repository + path: /home/runner/.m2/repository + + - name: Download build outputs + uses: actions/download-artifact@v8 + with: + name: build-target + path: target + + - name: Run unit tests + run: ./mvnw -B -ntp -P!quality-gates-all,nullaway verify + + - name: Upload JaCoCo report + uses: actions/upload-artifact@v7 + with: + name: jacoco-report + path: target/site/jacoco + if-no-files-found: error + + package: + if: ${{ github.event.pull_request.draft == false }} + needs: + - build + - test-unit + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: "21" + + - name: Set Maven wrapper permissions + run: chmod +x mvnw + + - name: Download Maven repository + uses: actions/download-artifact@v8 + with: + name: maven-repository + path: /home/runner/.m2/repository + + - name: Download build outputs + uses: actions/download-artifact@v8 + with: + name: build-target + path: target + + - name: Run package build + run: ./mvnw -B -ntp -P!quality-gates-all,nullaway -DskipTests package + + quality-crap-utils-java: + name: verify / quality-crap-utils-java + if: ${{ github.event.pull_request.draft == false }} + needs: + - build + - test-unit runs-on: ubuntu-latest steps: @@ -48,14 +145,37 @@ jobs: with: distribution: temurin java-version: "21" - cache: maven + + - name: Set Maven wrapper permissions + run: chmod +x mvnw + + - name: Download Maven repository + uses: actions/download-artifact@v8 + with: + name: maven-repository + path: /home/runner/.m2/repository + + - name: Download build outputs + uses: actions/download-artifact@v8 + with: + name: build-target + path: target + + - name: Download JaCoCo report + uses: actions/download-artifact@v8 + with: + name: jacoco-report + path: target/site/jacoco - name: Run crap-java gate - run: ./mvnw -B -ntp -P!quality-gates-all,quality-gate-crap verify + run: ./mvnw -B -ntp -P!quality-gates-all,quality-gate-crap,nullaway -DskipTests verify - cognitive-java: - name: cognitive-java Gate + quality-cognitive-utils-java: + name: verify / quality-cognitive-utils-java if: ${{ github.event.pull_request.draft == false }} + needs: + - build + - test-unit runs-on: ubuntu-latest steps: @@ -67,7 +187,27 @@ jobs: with: distribution: temurin java-version: "21" - cache: maven + + - name: Set Maven wrapper permissions + run: chmod +x mvnw + + - name: Download Maven repository + uses: actions/download-artifact@v8 + with: + name: maven-repository + path: /home/runner/.m2/repository + + - name: Download build outputs + uses: actions/download-artifact@v8 + with: + name: build-target + path: target + + - name: Download JaCoCo report + uses: actions/download-artifact@v8 + with: + name: jacoco-report + path: target/site/jacoco - name: Run cognitive-java gate - run: ./mvnw -B -ntp -P!quality-gates-all,quality-gate-cognitive verify + run: ./mvnw -B -ntp -P!quality-gates-all,quality-gate-cognitive,nullaway -DskipTests verify diff --git a/pom.xml b/pom.xml index 4c2dba7..3d6f9f7 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 0.0.1-SNAPSHOT HEAD - 0.3.2 + 0.5.0 0.4.0 21 UTF-8