mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-02 11:05:28 -04:00
50 lines
1.9 KiB
YAML
50 lines
1.9 KiB
YAML
# This workflow will build a Java project with Maven
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
|
|
name: Java CI with Maven
|
|
|
|
on:
|
|
push:
|
|
# branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
# build against supported Java LTS versions:
|
|
java: [ 8, 11, 17 ]
|
|
name: Java ${{ matrix.java }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up JDK ${{ matrix.java }}
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: ${{ matrix.java }}
|
|
cache: 'maven'
|
|
- name: Compile Java ${{ matrix.java }}
|
|
run: mvn clean compile -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true
|
|
- name: Run Tests ${{ matrix.java }}
|
|
run: |
|
|
mvn test -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }}
|
|
- name: Build Test Report ${{ matrix.java }}
|
|
if: ${{ always() }}
|
|
run: |
|
|
mvn surefire-report:report-only -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }}
|
|
mvn site -DgenerateReports=false -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }}
|
|
- name: Upload Test Results ${{ matrix.java }}
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: Test Results ${{ matrix.java }}
|
|
path: target/surefire-reports/
|
|
- name: Upload Test Report ${{ matrix.java }}
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: Test Report ${{ matrix.java }}
|
|
path: target/site/
|