Skip to content

PostGIS Java CI

PostGIS Java CI #75

Workflow file for this run

name: PostGIS Java CI
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
build-codebase:
strategy:
matrix:
os: [ubuntu-22.04]
jdk_version: [8.0.392-zulu, 11.0.21-zulu, 17.0.9-zulu, 21.0.1-zulu]
maven_version: [3.9.6]
include:
- os: ubuntu-22.04
jdk_version: 8.0.392-zulu
zulu_version: 8.74.0.17
maven_version: 3.9.6
maven_deploy: true
docker_build: true
maven_docker_container_image_repo: luminositylabs
maven_docker_container_image_name: maven
maven_docker_container_image_tag: 3.9.6_openjdk-8u392_zulu-8.74.0.17
name: Build on OS ${{ matrix.os }} with Maven ${{ matrix.maven_version }} using JDK ${{ matrix.jdk_version }}
runs-on: ${{ matrix.os }}
env:
MAVEN_PROPS: -Djavadoc.path=`which javadoc`
PROFILES: gpg,release-sign-artifacts,sonatype-deployment,sonatype-snapshots,sonatype-staging,sonatype-releases
SETTINGS: .github/settings.xml
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Install GPG and generate test key
run: .github/install-gpg.sh
- name: Install SDKMAN and java environment
run: |
.github/install-sdkman.sh ${{ matrix.jdk_version }} ${{ matrix.maven_version }}
echo "SDKMAN_DIR=${HOME}/.sdkman" >> $GITHUB_ENV
- name: Add SDKMAN candidate environment variables
run: |
echo "JAVA_HOME=${SDKMAN_DIR}/candidates/java/current" >> $GITHUB_ENV
echo "MAVEN_HOME=${SDKMAN_DIR}/candidates/maven/current" >> $GITHUB_ENV
- name: Add SDKMAN candidate paths to system path
run: |
echo "${JAVA_HOME}/bin" >> $GITHUB_PATH
echo "${MAVEN_HOME}/bin" >> $GITHUB_PATH
- name: Setup Maven repository cache
uses: actions/cache@v3
env:
cache-name: m2repo
with:
path: ~/.m2/repository
key: ${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ env.cache-name }}-
- name: Log github.ref
run: echo "${{ github.ref }}"
- name: List Maven repositories
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:list-repositories
- name: Show Maven dependency tree
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} dependency:tree
- name: Show Maven active profiles
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:active-profiles
- name: Show Maven effective POM
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} help:effective-pom
- name: Maven build/test
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} clean install
- name: Maven generate site
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} site site:stage
- name: Maven deploy
if: ${{ matrix.maven_deploy && (github.ref == 'refs/heads/main') && (github.event_name != 'pull_request') }}
env:
OSSRHU: ${{ secrets.OSSRHU }}
OSSRHT: ${{ secrets.OSSRHT }}
run: mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} ${{ env.MAVEN_PROPS }} deploy
- name: Docker maven build
if: ${{ matrix.docker_build }}
env:
CBD: /usr/src/build
P: luminositylabs-oss
run: docker container run --rm -i -v "$(pwd)":"${CBD}" -v ${HOME}/.gnupg:/root/.gnupg -v ${P}-${{ matrix.maven_docker_container_image_tag }}-mvn-repo:/root/.m2 -w "${CBD}" ${{ matrix.maven_docker_container_image_repo }}/${{ matrix.maven_docker_container_image_name }}:${{ matrix.maven_docker_container_image_tag }} mvn -U -V -s ${{ env.SETTINGS }} -P${{ env.PROFILES }} -Djavadoc.path=/usr/bin/javadoc -Dmaven.integration.test.skip=true dependency:list-repositories dependency:tree help:active-profiles clean install site site:stage