Skip to content

Merge pull request #118 from xdev-software/renovate/org.apache.maven.… #245

Merge pull request #118 from xdev-software/renovate/org.apache.maven.…

Merge pull request #118 from xdev-software/renovate/org.apache.maven.… #245

Workflow file for this run

name: Check Build
on:
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
java: [17, 21]
distribution: [temurin]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Build with Maven
run: ./mvnw -B clean package -P run-integration-tests
- name: Check for uncommited changes
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo ----------------------------------------
echo git status
echo ----------------------------------------
git status
echo ----------------------------------------
echo git diff
echo ----------------------------------------
git diff
echo ----------------------------------------
echo Troubleshooting
echo ----------------------------------------
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && ./mvnw -B clean package"
exit 1
fi
- name: Upload standalone server JAR
uses: actions/upload-artifact@v4
with:
name: server-${{ matrix.java }}
path: server/target/server-standalone.jar
if-no-files-found: error
# Build docker
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: ./server
push: false
tags: mockserver-standalone:experimental
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
checkstyle:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15
strategy:
matrix:
java: [17]
distribution: [temurin]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Run Checkstyle
run: ./mvnw -B checkstyle:check -P checkstyle -T2C
pmd:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
timeout-minutes: 15
strategy:
matrix:
java: [17]
distribution: [temurin]
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Run PMD
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C
- name: Run CPD (Copy Paste Detector)
# Todo: Readd pmd:cpd-check - Disabled for now due to upstream code
run: ./mvnw -B pmd:aggregate-cpd -P pmd -DskipTests -T2C
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: pmd-report
if-no-files-found: ignore
path: |
target/site/*.html
target/site/css/**
target/site/images/logos/maven-feather.png
target/site/images/external.png