JDK21: Added Java 21 CI build and updated docker images to JDK21 (#508) #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: JQM CI v2.x | |
on: | |
push: | |
branches: | |
- 2.2-maintenance | |
pull_request: | |
branches: | |
- 2.2-maintenance | |
workflow_dispatch: | |
defaults: | |
run: | |
working-directory: ./jqm-all | |
jobs: | |
jdk_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [6, 7, 8, 11, 17, 21] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: ${{ matrix.java }} | |
- name: Set up Maven | |
uses: stCarolas/setup-maven@v5 | |
with: | |
maven-version: 3.2.5 | |
- name: Check mvn | |
run: mvn -version | |
- name: Build | |
run: mvn -s ./jqm-engine/src/main/resources/META-INF/settings.xml install -DskipTests | |
- name: Test | |
run: mvn -s ./jqm-engine/src/main/resources/META-INF/settings.xml test | |
postgres_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
postgres: [9.6, 10] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: "zulu" | |
- uses: harmon758/postgresql-action@v1 | |
with: | |
postgresql version: ${{ matrix.postgres }} | |
postgresql db: "jqm" | |
postgresql user: "jqm" | |
postgresql password: "jqm" | |
- name: Build | |
run: mvn install -DskipTests | |
- name: Test | |
run: mvn test | |
env: | |
DB: postgresql | |
DB_VERSION: ${{ matrix.postgres }} | |
mysql_tests: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: jqm | |
MYSQL_USER: jqm | |
MYSQL_PASSWORD: jqm | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: "zulu" | |
- name: Build | |
run: mvn install -DskipTests | |
- name: Test | |
run: mvn test | |
env: | |
DB: mysql | |
DB_VERSION: 5.7 | |
db2_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- run: docker run --privileged=true --rm --name db2 --detach -p 50000:50000 -e "LICENSE=accept" -e "DB2INST1_PASSWORD=superpassword" -e "DBNAME=jqm" -e "ARCHIVE_LOGS=false" ibmcom/db2; | |
- run: while true; do if docker logs db2 2>/dev/null | grep -q "Setup has completed"; then break; fi; done | |
- run: docker exec db2 /bin/bash -c 'useradd -G db2iadm1 jqm; echo "jqm:jqm" | chpasswd'; | |
- run: docker exec --user db2inst1 db2 /bin/bash -c 'export DB2INSTANCE=db2inst1; printf "connect to jqm\n create schema jqm AUTHORIZATION jqm\n " | /opt/ibm/db2/V11.5/bin/db2 -v -'; | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: "zulu" | |
- name: Build | |
run: mvn install -DskipTests | |
- name: Test | |
run: mvn test | |
env: | |
DB: db2 | |
DB_VERSION: 11.5 | |
oracle_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Oracle container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: container-registry.oracle.com | |
password: ${{ secrets.DOCKER_ORACLE_REPO_PASSWORD }} | |
username: ${{ secrets.DOCKER_ORACLE_REPO_USERNAME }} | |
- run: docker run --detach --rm -p 1521:1521 --name oracle -e "DB_SID=JQM" container-registry.oracle.com/database/enterprise:12.2.0.1-slim; | |
- run: while true; do if docker ps | grep "oracle" | grep -q "(healthy)" ; then break; fi; done | |
- run: docker exec oracle /bin/bash -c ". /home/oracle/.bashrc ; printf 'alter session set \"_ORACLE_SCRIPT\"=true; \n CREATE USER JQM IDENTIFIED BY jqm DEFAULT TABLESPACE SYSAUX QUOTA UNLIMITED ON SYSAUX ACCOUNT UNLOCK;\n GRANT CONNECT, RESOURCE TO JQM;\n ALTER SYSTEM SET OPEN_CURSORS=9999 SCOPE=BOTH;\n ' | sqlplus / as sysdba"; | |
- name: Set up java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: "zulu" | |
- name: Build | |
run: mvn install -DskipTests | |
- name: Test | |
run: mvn test | |
env: | |
DB: oracle | |
DB_VERSION: 12.2 | |
publish_docker_image: | |
runs-on: ubuntu-latest | |
needs: [jdk_tests] | |
# trigger job on merge only | |
if: github.event.pull_request.merged == true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# Push only for linux | |
- name: Build and push docker image | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
file: docker/linux/Dockerfile | |
tags: enioka/jqm:v2-nightly | |
publish_snapshot: | |
runs-on: ubuntu-latest | |
needs: [jdk_tests] | |
# trigger job on merge only | |
if: github.event.pull_request.merged == true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Maven Central Repository | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: "zulu" | |
server-id: sonatype-nexus-snapshots | |
server-username: OSSRH_USERNAME | |
server-password: OSSRH_PASSWORD | |
- name: Publish package | |
run: mvn deploy | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN }} |