Skip to content

add branches wildcard to trigger commits but not tags for mvn.yml #152

add branches wildcard to trigger commits but not tags for mvn.yml

add branches wildcard to trigger commits but not tags for mvn.yml #152

Workflow file for this run

name: MVN Build
# The release script pushes tags and commits to the repository. Without tags-ignore, this would cause two builds to run.
on: { push: { branches: ["**"], tags-ignore: ["**"] } }
jobs:
build:
name: Java ${{ matrix.java }}
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: Maven build with Java 8 - includes tests
if: matrix.java == '8'
run: ./mvnw --batch-mode clean verify
# Skip tests for Java 16
- name: Maven build with Java 16 - skips tests
if: matrix.java == '16'
run: ./mvnw --batch-mode clean verify -DskipTests=true # still needs work to get tests running on java 16