This repository was archived by the owner on Sep 14, 2026. It is now read-only.
ci: bound Actions artifact retention #139
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Tests / ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Setup Java | |
| uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0 | |
| with: | |
| distribution: temurin | |
| java-version: "21" | |
| - name: Validate Gradle Wrapper | |
| uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 | |
| - name: Run tests and checks | |
| run: ./gradlew check jacocoAllReport --stacktrace | |
| - name: Publish coverage summary | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| run: | | |
| report="build/reports/jacoco/jacocoAllReport/jacocoAllReport.csv" | |
| awk -F, ' | |
| NR > 1 { | |
| branchMissed += $6 | |
| branchCovered += $7 | |
| lineMissed += $8 | |
| lineCovered += $9 | |
| } | |
| END { | |
| lineTotal = lineMissed + lineCovered | |
| branchTotal = branchMissed + branchCovered | |
| lineCoverage = lineTotal == 0 ? 100 : (lineCovered * 100 / lineTotal) | |
| branchCoverage = branchTotal == 0 ? 100 : (branchCovered * 100 / branchTotal) | |
| print "### JaCoCo coverage" | |
| print "" | |
| print "| Metric | Coverage |" | |
| print "| --- | ---: |" | |
| printf "| Lines | %.2f%% |\n", lineCoverage | |
| printf "| Branches | %.2f%% |\n", branchCoverage | |
| } | |
| ' "$report" >> "$GITHUB_STEP_SUMMARY" | |
| - name: Upload coverage report | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: jacoco-report-${{ github.run_id }} | |
| path: build/reports/jacoco/jacocoAllReport/html | |
| retention-days: 7 | |
| - name: Upload coverage to Codecov | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 | |
| with: | |
| files: build/reports/jacoco/jacocoAllReport/jacocoAllReport.xml | |
| fail_ci_if_error: false |