Skip to content

Commit

Permalink
Use matrix build for test workflow (#523)
Browse files Browse the repository at this point in the history
Simplifies workflow file, by using a matrix build
instead of separate build jobs with same steps.
  • Loading branch information
deejay1 authored Oct 1, 2023
1 parent 08abfa4 commit cb30492
Showing 1 changed file with 8 additions and 53 deletions.
61 changes: 8 additions & 53 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cb30492

Please sign in to comment.