mirror of
https://github.com/geoserver/geoserver-cloud.git
synced 2026-02-01 16:46:47 +00:00
Implements a build-tools module approach as used by Apache Commons, Spring, and Hibernate projects. This provides centralized code style rules that: - Enforce proper license headers in all Java files - Prohibit wildcard imports for improved code readability - Standardize naming conventions and formatting Build process is updated to include Checkstyle validation as part of the QA process.
115 lines
3.0 KiB
YAML
115 lines
3.0 KiB
YAML
# Triggers the workflow on pull request events to the main branch
|
|
name: Pull Request
|
|
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 build-tools 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
|
|
if: github.repository == 'geoserver/geoserver-cloud'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
needs: test
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
catalog: [ 'datadir', 'pgconfig' ]
|
|
#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 }}
|