2020-06-08 14:19:11 +00:00
|
|
|
name: Run Tests
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
2021-03-06 11:40:07 +00:00
|
|
|
build:
|
2020-06-08 14:19:11 +00:00
|
|
|
strategy:
|
2021-03-06 11:40:07 +00:00
|
|
|
fail-fast: false
|
2020-06-08 14:19:11 +00:00
|
|
|
matrix:
|
2021-12-04 14:27:36 +00:00
|
|
|
version: [7.3.1-jdk17]
|
2020-07-26 23:09:42 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
container:
|
2021-10-09 10:05:38 +00:00
|
|
|
image: gradle:${{ matrix.version }}
|
2020-07-26 23:09:42 +00:00
|
|
|
options: --user root
|
2020-06-08 14:19:11 +00:00
|
|
|
steps:
|
2021-03-06 11:40:07 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-07-16 17:16:39 +00:00
|
|
|
- uses: gradle/wrapper-validation-action@v1
|
2021-12-17 15:37:00 +00:00
|
|
|
- run: gradle build check -x test --stacktrace --warning-mode fail
|
2021-03-06 11:40:07 +00:00
|
|
|
|
|
|
|
# This job is used to feed the test matrix of next job to allow the tests to run in parallel
|
|
|
|
prepare_test_matrix:
|
|
|
|
# Lets wait to ensure it builds before going running tests
|
|
|
|
needs: build
|
2021-02-14 13:56:22 +00:00
|
|
|
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
container:
|
2021-12-04 14:27:36 +00:00
|
|
|
image: gradle:7.3.1-jdk17
|
2021-02-14 13:56:22 +00:00
|
|
|
options: --user root
|
2021-03-06 11:40:07 +00:00
|
|
|
|
2021-02-14 13:56:22 +00:00
|
|
|
steps:
|
2021-03-06 11:40:07 +00:00
|
|
|
- uses: actions/checkout@v2
|
2021-12-17 15:37:00 +00:00
|
|
|
- run: gradle writeActionsTestMatrix --stacktrace --warning-mode fail
|
2021-03-06 11:40:07 +00:00
|
|
|
-
|
|
|
|
id: set-matrix
|
|
|
|
run: echo "::set-output name=matrix::$(cat build/test_matrix.json)"
|
|
|
|
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
|
|
|
|
|
|
run_tests:
|
|
|
|
needs: prepare_test_matrix
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-12-04 14:27:36 +00:00
|
|
|
version: [7.3.1-jdk17]
|
2021-03-06 11:40:07 +00:00
|
|
|
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}
|
|
|
|
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
container:
|
2021-10-09 10:05:38 +00:00
|
|
|
image: gradle:${{ matrix.version }}
|
2021-03-06 11:40:07 +00:00
|
|
|
options: --user root
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-12-17 15:37:00 +00:00
|
|
|
- run: gradle test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
|
2021-02-14 13:56:22 +00:00
|
|
|
env:
|
2021-03-06 11:40:07 +00:00
|
|
|
TEST_WARNING_MODE: fail
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
2021-03-15 23:31:18 +00:00
|
|
|
if: ${{ failure() }}
|
2021-03-06 11:40:07 +00:00
|
|
|
with:
|
2021-06-13 09:50:17 +00:00
|
|
|
name: ${{ matrix.test }} (${{ matrix.java }}) Results
|
|
|
|
path: build/reports/
|
|
|
|
|
|
|
|
run_tests_windows:
|
|
|
|
needs: prepare_test_matrix
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-12-04 14:27:36 +00:00
|
|
|
java: [17]
|
2021-06-13 09:50:17 +00:00
|
|
|
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}
|
|
|
|
|
2021-12-04 14:27:36 +00:00
|
|
|
runs-on: windows-2022
|
2021-06-13 09:50:17 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: setup jdk ${{ matrix.java }}
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: ${{ matrix.java }}
|
2021-12-17 15:37:00 +00:00
|
|
|
- run: ./gradlew test --tests ${{ matrix.test }} --stacktrace --warning-mode fail
|
2021-06-13 09:50:17 +00:00
|
|
|
env:
|
|
|
|
TEST_WARNING_MODE: fail
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: ${{ failure() }}
|
|
|
|
with:
|
2021-03-06 11:40:07 +00:00
|
|
|
name: ${{ matrix.test }} (${{ matrix.java }}) Results
|
2021-03-15 23:31:18 +00:00
|
|
|
path: build/reports/
|
|
|
|
|
|
|
|
# Special case this test to run across all os's
|
|
|
|
reproducible_build_test:
|
|
|
|
needs: build
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-12-04 14:27:36 +00:00
|
|
|
java: [ 17 ]
|
|
|
|
os: [ windows-2022, ubuntu-20.04, macos-11 ]
|
2021-03-15 23:31:18 +00:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: ${{ matrix.java }}
|
|
|
|
|
2021-12-17 15:37:00 +00:00
|
|
|
- run: ./gradlew test --tests *ReproducibleBuildTest --stacktrace --warning-mode fail
|
2021-03-15 23:31:18 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: ${{ failure() }}
|
|
|
|
with:
|
|
|
|
name: Reproducible Build ${{ matrix.os }} (${{ matrix.java }}) Results
|
2021-12-04 14:27:36 +00:00
|
|
|
path: build/reports/
|