ci: add coverage check workflow (#6582) #1
This file contains hidden or 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: Base Coverage Upload | |
| on: | |
| push: | |
| branches: [ 'develop', 'release_**' ] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-base-coverage: | |
| name: Build Base Coverage | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 8 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '8' | |
| distribution: 'temurin' | |
| cache: 'gradle' | |
| - name: Check Java version | |
| run: java -version | |
| - name: Grant execute permission | |
| run: chmod +x gradlew | |
| - name: Stop Gradle daemon | |
| run: ./gradlew --stop || true | |
| - name: Build | |
| run: ./gradlew clean build --no-daemon --no-build-cache --parallel | |
| - name: Generate JaCoCo report | |
| run: ./gradlew jacocoTestReport --no-daemon --no-build-cache | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: base-jacoco-xml | |
| path: | | |
| actuator/build/reports/jacoco/test/jacocoTestReport.xml | |
| chainbase/build/reports/jacoco/test/jacocoTestReport.xml | |
| common/build/reports/jacoco/test/jacocoTestReport.xml | |
| consensus/build/reports/jacoco/test/jacocoTestReport.xml | |
| crypto/build/reports/jacoco/test/jacocoTestReport.xml | |
| framework/build/reports/jacoco/test/jacocoTestReport.xml | |
| plugins/build/reports/jacoco/test/jacocoTestReport.xml | |
| if-no-files-found: error | |
| upload-base-coverage: | |
| name: Upload Base Coverage to Codecov | |
| needs: build-base-coverage | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download coverage artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: base-jacoco-xml | |
| path: coverage-artifacts | |
| - name: Show coverage files | |
| run: find coverage-artifacts -type f | sort | |
| - name: Upload base coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| directory: ./coverage-artifacts | |
| root_dir: ./ | |
| gcov_executable: '' | |
| override_branch: ${{ github.ref_name }} | |
| fail_ci_if_error: true | |
| verbose: true |