Skip to content

Switch to spotless maven plugin with palantir formatting #726

Switch to spotless maven plugin with palantir formatting

Switch to spotless maven plugin with palantir formatting #726

Workflow file for this run

# Triggers the workflow on pull request events to the main branch
name: Pull Request on Main Branch
on:
pull_request:
branches:
- main
- "release/**"
paths:
- ".github/workflows/pull-request.yaml"
- ".github/workflows/build-and-push.yaml"
- "pom.xml"
- "Makefile"
- "config"
- "src/**"
- "acceptance_tests/**"
- "ci/**"
# cancel in-progress jobs or runs for this workflow for the same pr or branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build and Test Pull Request
if: github.repository == 'geoserver/geoserver-cloud'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Validate pom formatting
run: make lint-pom
- name: Validate source code formatting
run: make lint-java
- name: Test
run: |
# `make test` runs mvn verify, which includes mvn package, so no need to run `package` separatedly for the upload step below
make test
- name: Upload application jar files
uses: actions/upload-artifact@v4
with:
name: application-jars
path: |
./**/target/*-bin.jar
./**/target/config/
retention-days: 1
compression-level: 0 # no compression
acceptance:
name: Acceptance Tests
if: github.repository == 'geoserver/geoserver-cloud'
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test
strategy:
fail-fast: false
matrix:
catalog: [ 'datadir' ]
#catalog: [ 'datadir', 'pgconfig', 'jdbcconfig' ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download application jar files
uses: actions/download-artifact@v4
with:
name: application-jars
path: .
- name: Build images
# REPACKAGE=false avoids to re-package the apps during build-image
run: REPACKAGE=false make build-image
- name: Build acceptance tests docker image
run: |
make build-acceptance
- name: Install CI dependencies
id: installci
run: python3 -m pip install --user --requirement=ci/requirements.txt
- name: Launch ${{ matrix.catalog }} acceptance tests docker composition
id: start
run: |
make start-acceptance-tests-${{ matrix.catalog }}
- name: Run ${{ matrix.catalog }} acceptance tests
id: acceptance
run: |
make run-acceptance-tests-${{ matrix.catalog }}
- name: Print docker compose logs
if: always()
run: (cd compose && c2cciutils-docker-logs)
- name: Cleanup acceptance tests
if: always()
run: |
make clean-acceptance-tests-${{ matrix.catalog }}