From 56d69689a807e25d7b20564e91bf1c213389b9f2 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Mon, 26 Feb 2024 20:39:56 +0700 Subject: [PATCH] Expand build matrix, e.g. run on MasOS --- .github/workflows/main.yml | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd523d1..e3e0041 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,41 +9,27 @@ on: - '*' jobs: - check-gradle: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: 'Set up JDK' - uses: actions/setup-java@v4 - with: - java-version: 8 - distribution: temurin - - name: 'Init Gradle Build Action' - uses: gradle/gradle-build-action@v2 - with: - # cache options only count for the first invocation - cache-read-only: ${{ github.ref != 'refs/heads/master' }} - arguments: --version - - name: 'Check Spock' - uses: gradle/gradle-build-action@v2 - with: - arguments: check check-maven: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macOS-latest ] + javaVersion: [ 8, 21 ] + javaDist: [ temurin ] + runs-on: { { matrix.os } } steps: - uses: actions/checkout@v4 - name: Cache local Maven repository uses: actions/cache@v4 with: path: ~/.m2/repository - key: test-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + key: test-${{ matrix.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | - test-${{ runner.os }}-maven- - - name: 'Set up JDK' + test-${{ matrix.os }}-maven- + - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: 8 - distribution: temurin + java-version: ${{ matrix.javaVersion }} + distribution: ${{ matrix.javaDist }} - name: 'Check Spock' run: | ./mvnw -V -B verify