From cc4056047e8f6c63d1af3a08410ccb9d099453d2 Mon Sep 17 00:00:00 2001 From: Ice Date: Tue, 15 Apr 2025 15:45:00 -0400 Subject: [PATCH] Create pr-testomg --- .github/workflows/pr-testomg | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/pr-testomg diff --git a/.github/workflows/pr-testomg b/.github/workflows/pr-testomg new file mode 100644 index 00000000..19c71491 --- /dev/null +++ b/.github/workflows/pr-testomg @@ -0,0 +1,36 @@ +name: PR testing + +on: + pull_request: + branches: [ master ] + +jobs: + mavenTesting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up the Java JDK + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Load custom deps + run: | + mvn install -DskipTests=true --file pom.xml + + - name: Run all tests + run: | + mvn -B clean test -DskipTests=false --file pom.xml + if [ -f "target/site/jacoco/index.html" ]; then echo "Total coverage: $(cat target/site/jacoco/index.html | grep -o 'Total[^%]*%' | grep -o '[0-9]*%')"; fi + + - name: Log coverage percentage + run: | + if [ ! -f "target/site/jacoco/index.html" ]; then echo "No coverage information available"; fi + if [ -f "target/site/jacoco/index.html" ]; then echo "Total coverage: $(cat target/site/jacoco/index.html | grep -o 'Total[^%]*%' | grep -o '[0-9]*%')"; fi