diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml deleted file mode 100644 index 410339fd0cf..00000000000 --- a/.github/workflows/checks.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: checks - -on: - pull_request: - -env: - GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true - -jobs: - lint: - 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 - gradle-wrapper: - name: "Gradle Wrapper Validation" - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: gradle/wrapper-validation-action@v1.1.0 - 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: adopt - java-version: 17 - - name: Setup Gradle - uses: gradle/gradle-build-action@v2.10.0 - - name: run spotless - run: ./gradlew spotlessCheck -Dorg.gradle.parallel=true -Dorg.gradle.caching=true diff --git a/.github/workflows/pre-review.yml b/.github/workflows/pre-review.yml new file mode 100644 index 00000000000..9d07d2e7b79 --- /dev/null +++ b/.github/workflows/pre-review.yml @@ -0,0 +1,84 @@ +name: pre-review + +on: + pull_request: + +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 + gradle-wrapper: + name: "Gradle Wrapper Validation" + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: gradle/wrapper-validation-action@v1.1.0 + 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: adopt + java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.10.0 + - name: run spotless + run: ./gradlew spotlessCheck -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + 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: adopt + java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2.10.0 + - name: Run Build + run: ./gradlew build -x test -x spotlessCheck -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + unitTests: + runs-on: besu-research-ubuntu-8 + needs: [ compile ] + permissions: + checks: write + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: adopt + java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + run: ./gradlew build -Dorg.gradle.parallel=true -Dorg.gradle.caching=true + - name: Upload Test Report + uses: actions/upload-artifact@v3 + if: always() # always run even if the previous step fails + with: + name: junit-xml-reports + path: '**/build/test-results/test/TEST-*.xml' + retention-days: 1 + - 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