Skip to content

Commit

Permalink
Update maven.yml
Browse files Browse the repository at this point in the history
The current GitHub Action configuration for the openmrs-module-uiframework repository uses separate jobs for building the project with different Java versions (8, 11, and 17). This can be simplified by using a matrix strategy to reduce redundancy and improve maintainability.

So this is the matrix stratergy .
  • Loading branch information
virajwathsalag authored Jul 20, 2024
1 parent deb4289 commit 5f2b621
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,25 @@ 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: Display Java version
run: java -version

- name: Build with Maven
run: mvn clean install --file pom.xml

0 comments on commit 5f2b621

Please sign in to comment.