1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

update pipline to use matrix configuration

This commit is contained in:
John J. Aylward 2020-06-03 18:29:29 -04:00
parent f4261add91
commit 96bf788515

View file

@ -5,49 +5,51 @@ name: Java CI with Maven
on: on:
push: push:
branches: [ master ] # branches: [ master ]
pull_request: pull_request:
branches: [ master ] branches: [ master ]
jobs: jobs:
compile: # old-school build and jar method. No tests run or compiled.
runs-on: ubuntu-latest build-1_6:
runs-on: ubuntu-16.04
strategy:
matrix:
# build for java 1.6, however don't run any tests
java: [ 1.6 ]
name: Java ${{ matrix.java }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 1.8 - name: Setup java
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: ${{ matrix.java }}
- name: Compile with Maven - name: Compile Java ${{ matrix.java }}
run: mvn compile run: |
- name: Assemble with Gradle mkdir -p target/classes
run: sh ./gradlew assemble javac -d target/classes/ src/main/java/org/json/*.java
test: - name: Create java ${{ matrix.java }} JAR
runs-on: ubuntu-latest run: |
steps: jar cvf target/org.json.jar -C target/classes .
- uses: actions/checkout@v2 - name: Upload Java ${{ matrix.java }} JAR
- name: Set up JDK 1.8 uses: actions/upload-artifact@v1
uses: actions/setup-java@v1 with:
with: name: Java ${{ matrix.java }} JAR
java-version: 1.8 path: target/org.json.jar
- name: Test with Maven
run: mvn test
- name: Gradle Check, Gradle Test is inclusive
run: sh ./gradlew assemble check
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-16.04
strategy:
matrix:
# build against supported Java LTS versions:
java: [ 1.7, 8, 11 ]
name: Java ${{ matrix.java }} Compile
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 1.8 - name: Setup java
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 1.8 java-version: ${{ matrix.java }}
- name: Build with Maven - 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
run: mvn -B package --file pom.xml - run: mvn test -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true
- name: Build with Gradle
run: sh ./gradlew build
#- name: Publish to GitHub Packages Apache Maven
# run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
# env:
# GITHUB_TOKEN: ${{ github.token }}