ci: add github actions build matrix #114
Workflow file for this run
This file contains hidden or 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: MVN Build | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
java: [8, 16] # Define matrix for Java versions | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Install socat tool | |
run: | | |
sudo apt-get update | |
sudo apt-get install socat | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: ./parsec-docker-test-image/parsec_docker_cache | |
key: ${{ runner.os }}-parsec_docker_cache-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-parsec_docker_cache- | |
# Use the matrix variable to set up the correct JDK | |
- name: Set up JDK ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: "zulu" | |
architecture: x64 | |
cache: maven | |
# Run tests only for Java 8 | |
- name: Build with Maven (Java 8 - includes tests) | |
if: matrix.java == '8' | |
run: ./mvnw --batch-mode clean verify | |
# Skip tests for Java 16 | |
- name: Build with Maven (Java 16 - skips tests) | |
if: matrix.java == '16' | |
run: ./mvnw --batch-mode clean verify -DskipTests=true |