Fix Quilt Loader dependency override #312
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
name: Run Tests | |
on: [push, pull_request] | |
concurrency: | |
group: build-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Nobody" | |
- uses: gradle/wrapper-validation-action@v2 | |
- run: ./gradlew applyPatches | |
- run: ./gradlew build check -x test --stacktrace --warning-mode fail | |
working-directory: patched-quilt-loom | |
build_windows: | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Nobody" | |
- uses: gradle/wrapper-validation-action@v2 | |
- run: ./gradlew applyPatches | |
- run: ./gradlew build check -x test --stacktrace --warning-mode fail | |
working-directory: patched-quilt-loom | |
# This job is used to feed the test matrix of next job to allow the tests to run in parallel | |
prepare_test_matrix: | |
# Wait to ensure it builds before going running tests | |
needs: build | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Nobody" | |
- uses: gradle/wrapper-validation-action@v2 | |
- run: ./gradlew applyPatches | |
- run: ./gradlew writeActionsTestMatrix --stacktrace --warning-mode fail | |
working-directory: patched-quilt-loom | |
- id: set-matrix | |
run: echo "matrix=$(cat patched-quilt-loom/build/test_matrix.json)" >> $GITHUB_OUTPUT | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
run_tests: | |
needs: prepare_test_matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [8.6.0-jdk17] | |
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }} | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: setup jdk | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Nobody" | |
- uses: gradle/wrapper-validation-action@v2 | |
- run: ./gradlew applyPatches | |
- run: ./gradlew printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail | |
working-directory: patched-quilt-loom | |
env: | |
TEST_WARNING_MODE: fail | |
id: test | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{ matrix.test }} (${{ matrix.java }}) Results | |
path: patched-quilt-loom/build/reports/ | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{ steps.test.outputs.test }} Heap Dump | |
path: "*.hprof" | |
run_tests_windows: | |
needs: prepare_test_matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }} | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Nobody" | |
- uses: gradle/wrapper-validation-action@v1 | |
- name: setup jdk | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
- run: ./gradlew applyPatches | |
- run: ./gradlew printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace --warning-mode fail | |
working-directory: patched-quilt-loom | |
env: | |
TEST_WARNING_MODE: fail | |
id: test | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{ matrix.test }} (${{ matrix.java }}) Results (Windows) | |
path: patched-quilt-loom/build/reports/ | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: ${{ steps.test.outputs.test }} Heap Dump (Windows) | |
path: "*.hprof" | |
# Special case this test to run across all os's | |
reproducible_build_test: | |
needs: build | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ 17, 21 ] | |
os: [ windows-2022, ubuntu-22.04, macos-12 ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- run: git config --global user.email "[email protected]" | |
- run: git config --global user.name "Nobody" | |
- uses: gradle/wrapper-validation-action@v1 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
- run: ./gradlew applyPatches | |
- run: ./gradlew test --tests *ReproducibleBuildTest --stacktrace --warning-mode fail | |
working-directory: patched-quilt-loom | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: Reproducible Build ${{ matrix.os }} (${{ matrix.java }}) Results | |
path: patched-quilt-loom/build/reports/ |