Skip to content

Update build.yml

Update build.yml #68

Workflow file for this run

name: Build & Test
on:
push:
branches: [ main, '*' ]
pull_request:
branches: [ main ]
jobs:
build:
name: Java ${{ matrix.java }} build
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ]
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-package: jdk
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -B package --file pom.xml
- run: mkdir artifacts && cp target/*.jar artifacts
- name: Upload Maven build artifact
uses: actions/upload-artifact@v3
with:
name: build-java-${{ matrix.java }}.jar
path: artifacts
test:
name: Java ${{ matrix.java }} test
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ]
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Run tests with Maven
run: mvn -B test --file pom.xml