lets run the unit tests before trying to shard them #1
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: unit-tests | ||
on: | ||
pull_request_review: | ||
types: [ submitted ] | ||
env: | ||
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.daemon=false" | ||
total-runners: 6 | ||
jobs: | ||
runner-indexes: | ||
runs-on: | ||
group: "Besu Large Runners" | ||
name: Generate runner indexes | ||
unitTests: | ||
runs-on: | ||
group: "Besu Large Runners" | ||
name: "Unit Test Runner #${{ matrix.runner-index }}: Run unit tests in parallel" | ||
needs: | ||
- runner-indexes | ||
if: ${{ github.actor != 'dependabot[bot]'}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: adopt | ||
java-version: 17 | ||
cache: gradle | ||
- name: Compile | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true | ||
cache-read-only: false | ||
arguments: build -Dorg.gradle.parallel=true | ||
- name: Upload Unit Test Report | ||
uses: actions/upload-artifact@v3 | ||
if: always() # always run even if the previous step fails | ||
with: | ||
name: junit-unit-${{ matrix.runner-index }}-test-results | ||
path: '**/test-results/test/TEST-*.xml' | ||
retention-days: 10 | ||
- name: Unit Test Report html | ||
uses: actions/upload-artifact@v3 | ||
if: always() # always run even if the previous step fails | ||
with: | ||
name: html-unit-${{ matrix.runner-index }}-test-results | ||
path: '**/build/reports/tests/test/**' | ||
retention-days: 10 |