Update build.yml #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ 1.8, 9, 11, 12, 13, 14, 15, 16, 17 ] | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
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@v2 | |
with: | |
name: build-java-${{ matrix.java }}.jar | |
path: artifacts | |
test: | |
name: Java ${{ matrix.java }} test | |
needs: [build] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [ 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ] | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
- name: Run tests with Maven | |
run: mvn -B test --file pom.xml |