mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-01 21:17:46 -05:00
Rewrite tests to be easier to write and maintain (#361)
This commit is contained in:
55
.github/workflows/test-push.yml
vendored
55
.github/workflows/test-push.yml
vendored
@@ -1,10 +1,11 @@
|
||||
name: Run Tests
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
gradle:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
gradle: [4.9, 4.10.2, 6.8.2]
|
||||
gradle: [4.9, 4.10.2, 6.8.3]
|
||||
java: [jdk8, jdk11, jdk15]
|
||||
exclude: # Dont run older gradle versions on newer java
|
||||
- java: jdk15
|
||||
@@ -20,18 +21,52 @@ jobs:
|
||||
image: gradle:${{ matrix.gradle }}-${{ matrix.java }}
|
||||
options: --user root
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- run: gradle build check test --stacktrace
|
||||
- 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
|
||||
|
||||
gradle_pre_release:
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: openjdk:8-jdk
|
||||
image: gradle:6.8.3-jdk15
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- run: ./gradlew wrapper --gradle-version=7.0-milestone-1
|
||||
- run: ./gradlew build check test --stacktrace --warning-mode fail
|
||||
- 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, jdk15]
|
||||
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }}
|
||||
|
||||
runs-on: ubuntu-20.04
|
||||
container:
|
||||
image: gradle:6.8.3-${{ matrix.java }}
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: gradle test --tests *${{ matrix.test }} --stacktrace
|
||||
env:
|
||||
TEST_WARNING_MODE: fail
|
||||
TEST_WARNING_MODE: fail
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: ${{ matrix.test }} (${{ matrix.java }}) Results
|
||||
path: build/reports/
|
||||
Reference in New Issue
Block a user