From eabf0d7ded27392bbd4bab0df4529ac90524663b Mon Sep 17 00:00:00 2001 From: Viraj Wathsala Gunasinghe Date: Mon, 22 Jul 2024 15:18:31 +0530 Subject: [PATCH] (chore) UIFR-224: Simplify the build GitHub Action with Matrix Strategy (#81) Co-authored-by: Jayasanka Weerasinghe <33048395+jayasanka-sack@users.noreply.github.com> --- .github/workflows/maven.yml | 41 ++++++++----------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 240d67e..53d7ab5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -8,47 +8,22 @@ on: branches: [ "master" ] jobs: - java-8: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 8 - uses: actions/setup-java@v3 - with: - java-version: '8' - distribution: 'adopt' - cache: maven - - name: Build with Maven - run: mvn clean install --file pom.xml - - java-11: - + build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'adopt' - cache: maven - - name: Build with Maven - run: mvn clean install --file pom.xml - - java-17: - - runs-on: ubuntu-latest + strategy: + matrix: + java-version: [8, 11, 17] steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + + - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v3 with: - java-version: '17' + java-version: ${{ matrix.java-version }} distribution: 'adopt' cache: maven + - name: Build with Maven run: mvn clean install --file pom.xml