Refactor/category UI #212
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-kover | |
| on: | |
| pull_request: | |
| branches: [ main, development ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| checks: write | |
| jobs: | |
| run-tests: | |
| name: Run Tests and Generate Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Run tests and generate Kover reports | |
| run: ./gradlew test koverHtmlReport | |
| - name: Verify coverage thresholds (≥ 80%) | |
| run: ./gradlew koverVerify | |
| - name: Debug test result files | |
| if: always() | |
| run: | | |
| echo "Checking if test results exist..." | |
| ls -l build/test-results/test || echo "Directory not found" | |
| - name: Upload test results (JUnit XML) | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: build/test-results/test/TEST-*.xml | |
| - name: Upload Kover HTML report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kover-html-report | |
| path: build/reports/kover/html/ | |
| publish-test-results: | |
| name: Comment on PR with Test Results | |
| needs: run-tests | |
| runs-on: ubuntu-latest | |
| if: ${{ always() && github.event_name == 'pull_request' }} | |
| steps: | |
| - name: Download test results | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: test-results | |
| path: test-results | |
| - name: Publish Unit Test Results as PR comment | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| with: | |
| files: test-results/TEST-*.xml | |
| upload-coverage-html: | |
| name: Upload HTML Coverage Report (Separate Job) | |
| needs: run-tests | |
| runs-on: ubuntu-latest | |
| if: always() | |
| steps: | |
| - name: Download Kover HTML report | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: kover-html-report | |
| path: build/reports/kover/html/ | |
| - name: Confirm HTML report upload | |
| run: echo "Kover HTML report is available as artifact." |