fabric-loom/.github/workflows/test-push.yml

92 lines
2.5 KiB
YAML
Raw Normal View History

name: Run Tests
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
gradle: [7.0-rc-2]
java: [jdk8, jdk11, jdk16]
jvm: [hotspot]
runs-on: ubuntu-20.04
container:
image: ghcr.io/modmuss50/gradle:${{ matrix.gradle }}-${{ matrix.java }}-hotspot
options: --user root
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- run: gradle build check -x test --stacktrace
# 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
runs-on: ubuntu-20.04
container:
image: ghcr.io/modmuss50/gradle:7.0-rc-2-jdk16-hotspot
options: --user root
steps:
- uses: actions/checkout@v2
- run: gradle writeActionsTestMatrix --stacktrace
-
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:
java: [jdk8, jdk11, jdk16]
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}
exclude:
- java: jdk16
test: net.fabricmc.loom.test.intergration.KotlinTest
runs-on: ubuntu-20.04
container:
image: ghcr.io/modmuss50/gradle:7.0-rc-2-${{ matrix.java }}-hotspot
options: --user root
steps:
- uses: actions/checkout@v2
2021-04-02 11:20:03 +00:00
- run: gradle test --tests ${{ matrix.test }} --stacktrace
env:
TEST_WARNING_MODE: fail
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: ${{ matrix.test }} (${{ matrix.java }}) Results
path: build/reports/
# Special case this test to run across all os's
reproducible_build_test:
needs: build
strategy:
fail-fast: false
matrix:
java: [ 1.8, 11, 16 ]
os: [ windows-2019, ubuntu-20.04, macos-10.15 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- run: ./gradlew test --tests *ReproducibleBuildTest --stacktrace
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: Reproducible Build ${{ matrix.os }} (${{ matrix.java }}) Results
path: build/reports/