Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 151 additions & 11 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
cancel-in-progress: true

jobs:
test:
build:
if: ${{ github.event.pull_request.draft == false }}
runs-on: ubuntu-latest

Expand All @@ -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
Comment thread
fabian-barney marked this conversation as resolved.

- name: Upload Maven repository
uses: actions/upload-artifact@v7
with:
name: maven-repository
path: /home/runner/.m2/repository
if-no-files-found: error
Comment thread
fabian-barney marked this conversation as resolved.
Comment thread
fabian-barney marked this conversation as resolved.
Comment thread
fabian-barney marked this conversation as resolved.

- name: Upload build outputs
uses: actions/upload-artifact@v7
with:
name: build-target
path: target
if-no-files-found: error
Comment thread
fabian-barney marked this conversation as resolved.

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
Comment thread
fabian-barney marked this conversation as resolved.

- 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

Comment thread
fabian-barney marked this conversation as resolved.
- 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
Comment thread
fabian-barney marked this conversation as resolved.

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:
Expand All @@ -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

Comment thread
fabian-barney marked this conversation as resolved.
- 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
Comment thread
fabian-barney marked this conversation as resolved.
Comment thread
fabian-barney marked this conversation as resolved.

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:
Expand All @@ -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
Comment thread
fabian-barney marked this conversation as resolved.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<properties>
<revision>0.0.1-SNAPSHOT</revision>
<scm.tag>HEAD</scm.tag>
<crap-java.version>0.3.2</crap-java.version>
<crap-java.version>0.5.0</crap-java.version>
<cognitive-java.version>0.4.0</cognitive-java.version>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down