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:
parent
f4261add91
commit
96bf788515
1 changed files with 41 additions and 39 deletions
80
.github/workflows/pipeline.yml
vendored
80
.github/workflows/pipeline.yml
vendored
|
@ -5,49 +5,51 @@ name: Java CI with Maven
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
# branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
runs-on: ubuntu-latest
|
||||
# old-school build and jar method. No tests run or compiled.
|
||||
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:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Compile with Maven
|
||||
run: mvn compile
|
||||
- name: Assemble with Gradle
|
||||
run: sh ./gradlew assemble
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Test with Maven
|
||||
run: mvn test
|
||||
- name: Gradle Check, Gradle Test is inclusive
|
||||
run: sh ./gradlew assemble check
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup java
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
- name: Compile Java ${{ matrix.java }}
|
||||
run: |
|
||||
mkdir -p target/classes
|
||||
javac -d target/classes/ src/main/java/org/json/*.java
|
||||
- name: Create java ${{ matrix.java }} JAR
|
||||
run: |
|
||||
jar cvf target/org.json.jar -C target/classes .
|
||||
- name: Upload Java ${{ matrix.java }} JAR
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Java ${{ matrix.java }} JAR
|
||||
path: target/org.json.jar
|
||||
|
||||
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:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
- 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 }}
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup java
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ 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
|
||||
- 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
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue