From cb30492b7acbbcec60b91d78960287ad4147de46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Jerna=C5=9B?= Date: Sun, 1 Oct 2023 06:48:13 +0200 Subject: [PATCH] Use matrix build for test workflow (#523) Simplifies workflow file, by using a matrix build instead of separate build jobs with same steps. --- .github/workflows/test.yml | 61 +++++--------------------------------- 1 file changed, 8 insertions(+), 53 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f950102..7aea5ab9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,67 +31,22 @@ jobs: - uses: actions/checkout@v4 - name: scalafmt test run: ./sbt scalafmtCheckAll - test: - name: test jdk11 + test-jdk: + strategy: + matrix: + version: [ '8', '11', '17', '21' ] + name: test jdk${{ matrix.version }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: '11' + java-version: ${{ matrix.version }} - uses: actions/cache@v3 with: path: ~/.cache - key: ${{ runner.os }}-jdk11-${{ hashFiles('**/*.sbt') }} - restore-keys: ${{ runner.os }}-jdk11- - - name: Test - run: ./sbt test - test_jdk8: - name: test jdk8 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '8' - - uses: actions/cache@v3 - with: - path: ~/.cache - key: ${{ runner.os }}-jdk8-${{ hashFiles('**/*.sbt') }} - restore-keys: ${{ runner.os }}-jdk8- - - name: Test - run: ./sbt test - test_jdk17: - name: test jdk17 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '17' - - uses: actions/cache@v3 - with: - path: ~/.cache - key: ${{ runner.os }}-jdk17-${{ hashFiles('**/*.sbt') }} - restore-keys: ${{ runner.os }}-jdk17- - - name: Test - run: ./sbt test - test_jdk21: - name: test jdk21 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '21' - - uses: actions/cache@v3 - with: - path: ~/.cache - key: ${{ runner.os }}-jdk21-${{ hashFiles('**/*.sbt') }} - restore-keys: ${{ runner.os }}-jdk21- + key: ${{ runner.os }}-jdk${{ matrix.version }}-${{ hashFiles('**/*.sbt') }} + restore-keys: ${{ runner.os }}-jdk${{ matrix.version }}- - name: Test run: ./sbt test