-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #527 from johnjaylward/GithubAction
Fixes for Unit tests and supports GitHub Actions
- Loading branch information
Showing
6 changed files
with
182 additions
and
190 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# 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: | ||
# 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: 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-16.04 | ||
strategy: | ||
matrix: | ||
# build against supported Java LTS versions: | ||
java: [ 1.7, 8, 11 ] | ||
name: Java ${{ matrix.java }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
- 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/ |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.