Skip to content

Merge pull request #505 from gregjotau/fix/docker-catalina-opts #793

Merge pull request #505 from gregjotau/fix/docker-catalina-opts

Merge pull request #505 from gregjotau/fix/docker-catalina-opts #793

Workflow file for this run

#
# Copyright (C) 2015-2022 Philip Helger (www.helger.com)
# philip[at]helger[dot]com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Maven build
on:
push:
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 17, 21, 25 ]
name: Java ${{ matrix.java }} build
services:
mysql:
image: mysql:8
env:
# The MySQL docker container requires these environment variables to be set
# so we can create and migrate the test database.
# See: https://hub.docker.com/_/mysql
MYSQL_DATABASE: smp
MYSQL_ROOT_PASSWORD: smp
# Additional properties for testing
MYSQL_USER: smp
MYSQL_PASSWORD: smp
ports:
# Opens port 3306 on service container and host
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
- 3306:3306
# Before continuing, verify the mysql container is reachable from the ubuntu host
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v6
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Cache local Maven repository
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.12.1
with:
mongodb-version: '8.0'
- name: Build and deploy with Maven
run: mvn --batch-mode --update-snapshots -P release-snapshot deploy
if: github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && matrix.java == 17
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: Maven Build
run: mvn --batch-mode --update-snapshots install
if: github.event_name != 'push' || github.ref != format('refs/heads/{0}', github.event.repository.default_branch) || matrix.java != 17