Skip to content

Merge branch 'master' into with_tests #14

Merge branch 'master' into with_tests

Merge branch 'master' into with_tests #14

Workflow file for this run

name: java-build
on:
push:
paths:
- 'java/**'
- '.github/workflows/java-build.yml'
pull_request:
paths:
- 'java/**'
- '.github/workflows/java-build.yml'
jobs:
build:
defaults:
run:
working-directory: ./java
runs-on: ubuntu-latest
env:
DB_USER: root
DB_OLD_PASSWORD: root
DB_PASSWORD: mysql
strategy:
matrix:
java-version: [8, 11, 17, 21]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Start MYSQL and import DB
run: |
sudo systemctl start mysql
mysqladmin --user=${{ env.DB_USER }} --password=${{ env.DB_OLD_PASSWORD }} password ${{ env.DB_PASSWORD }}
mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} < ${GITHUB_WORKSPACE}/database/initDatabase.sql
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java-version }}
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('./pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and test
run: |
mvn -B clean verify