chore(build_snapshot): publish to github packages #2
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: | |
strategy: | |
fail-fast: false | |
matrix: | |
gradle: [ | |
8.4, | |
8.7, # version used by buildscript | |
8 # latest | |
] | |
java: [ | |
8, # Old LTS | |
11, # Should we even test this one? | |
17, # LTS | |
21 # Latest LTS only supported by gradle 8.5+ | |
] | |
exclude: | |
- gradle: 8.1 | |
java: 21 | |
- gradle: 8.4 | |
java: 21 | |
runs-on: ubuntu-22.04 | |
container: | |
image: gradle:${{ matrix.gradle }}-jdk${{ matrix.java }} | |
options: --user root | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/wrapper-validation-action@v2 | |
# Update when https://github.com/gradle/gradle/issues/25609 is fixed | |
- if: ${{ matrix.gradle == '8.1' && matrix.java == 17 }} | |
run: gradle build check -x test --stacktrace --warning-mode fail | |
- if: ${{ matrix.gradle != '8.1' || matrix.java != 17 }} | |
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-22.04 | |
container: | |
image: gradle:8.4.0-jdk17 | |
options: --user root | |
steps: | |
- uses: actions/checkout@v4 | |
- run: gradle writeActionsTestMatrix --stacktrace | |
- | |
id: set-matrix | |
run: echo "matrix=$(cat build/test_matrix.json)" >> $GITHUB_OUTPUT | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
run_tests: | |
needs: prepare_test_matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [17] | |
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }} | |
runs-on: ubuntu-22.04 | |
container: | |
image: gradle:8.7-jdk${{ matrix.java }} | |
options: --user root | |
steps: | |
- uses: actions/checkout@v4 | |
- run: gradle printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace | |
env: | |
TEST_WARNING_MODE: fail | |
id: test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: ${{ steps.test.outputs.test }} Results | |
path: build/reports/ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: ${{ steps.test.outputs.test }} Heap Dump | |
path: "*.hprof" | |
run_tests_windows: | |
needs: prepare_test_matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [21] | |
test: ${{ fromJson(needs.prepare_test_matrix.outputs.matrix) }} | |
runs-on: windows-2022 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup jdk ${{ matrix.java }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ matrix.java }} | |
distribution: 'temurin' | |
- run: ./gradlew printActionsTestName --name="${{ matrix.test }}" test --tests ${{ matrix.test }} --stacktrace | |
env: | |
TEST_WARNING_MODE: fail | |
id: test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: ${{ steps.test.outputs.test }} (${{ matrix.java }}) Results (Windows) | |
path: build/reports/ | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: ${{ steps.test.outputs.test }} Heap Dump (Windows) | |
path: "*.hprof" |