consolidate status to get rid of shard-specific ones #105
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: pre-review | |
on: | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
statuses: write | |
checks: write | |
env: | |
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true | |
jobs: | |
repolint: | |
name: "Repository Linting" | |
runs-on: ubuntu-22.04 | |
container: ghcr.io/todogroup/repolinter:v0.11.2 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Lint Repo | |
run: bundle exec /app/bin/repolinter.js --rulesetUrl https://raw.githubusercontent.com/hyperledger-labs/hyperledger-community-management-tools/main/repo_structure/repolint.json --format markdown | |
- name: flag repolint failure | |
uses: myrotvorets/[email protected] | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
context: pre-review | |
description: repo linting failed | |
gradle-wrapper: | |
name: "Gradle Wrapper Validation" | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/[email protected] | |
- name: flag gradle wrapper failure | |
uses: myrotvorets/[email protected] | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
context: pre-review | |
description: gradlew validation failed | |
spotless: | |
runs-on: ubuntu-22.04 | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: run spotless | |
run: ./gradlew spotlessCheck -Dorg.gradle.parallel=true -Dorg.gradle.caching=true | |
- name: flag spotless failure | |
uses: myrotvorets/[email protected] | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
context: pre-review | |
description: spotless failed | |
compile: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: [spotless, gradle-wrapper, repolint] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Gradle Compile | |
run: ./gradlew build -x test -x spotlessCheck -Dorg.gradle.parallel=true -Dorg.gradle.caching=true | |
- name: flag compile failure | |
uses: myrotvorets/[email protected] | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
context: pre-review | |
description: compilation failed | |
unitTests: | |
env: | |
GRADLEW_UNIT_TEST_ARGS: ${{matrix.gradle_args}} | |
runs-on: ubuntu-22.04 | |
needs: [ compile ] | |
permissions: | |
checks: write | |
statuses: write | |
strategy: | |
fail-fast: false | |
matrix: | |
gradle_args: | |
- "test -x besu:test -x consensus:test -x crypto:test -x ethereum:eth:test -x ethereum:api:test -x ethereum:core:test" | |
- "besu:test consensus:test crypto:test" | |
- "ethereum:api:testBonsai" | |
- "ethereum:api:testForest" | |
- "ethereum:api:testRemainder" | |
- "ethereum:core:test" | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: run unit tests | |
id: unitTest | |
run: ./gradlew $GRADLEW_UNIT_TEST_ARGS -Dorg.gradle.parallel=true -Dorg.gradle.caching=true | |
- name: flag failed unit tests | |
uses: myrotvorets/[email protected] | |
if: failure() | |
with: | |
status: ${{ job.status }} | |
context: unit-tested | |
description: unit test shard failed | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
if: success() || failure() # always run even if the build step fails | |
with: | |
report_paths: '**/test-results/test/TEST-*.xml' | |
annotate_only: true | |
consolidateStatus: | |
runs-on: ubuntu-22.04 | |
needs: unitTests | |
permissions: | |
statuses: write | |
checks: write | |
steps: | |
- name: status success | |
uses: myrotvorets/[email protected] | |
with: | |
status: success | |
context: unit-tested | |
description: unit tests passed | |