Adding some test between the years #189
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: Build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| - develop | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6.0.1 | |
| - name: timezone | |
| uses: szenius/set-timezone@v2.0 | |
| with: | |
| timezoneLinux: "Europe/Berlin" | |
| timezoneMacos: "Europe/Berlin" | |
| timezoneWindows: "W. Europe Standard Time" | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5.1.0 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: 'gradle' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v5.0.0 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: build/reports/tests/test/ | |
| retention-days: 7 | |
| - name: Add coverage to PR | |
| id: jacoco | |
| uses: madrapps/jacoco-report@v1.7.2 | |
| with: | |
| paths: ${{ github.workspace }}/build/customJacocoReportDir/test/jacocoTestReport.xml | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| min-coverage-overall: 85 | |
| min-coverage-changed-files: 75 | |
| title: Code Coverage | |
| update-comment: true | |
| - name: Fail PR if overall coverage is less than 85% | |
| if: ${{ steps.jacoco.outputs.coverage-overall < 85.0 }} | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| core.setFailed('Overall coverage is less than 85%!') | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: build-artifacts | |
| path: build/libs/*.jar | |
| retention-days: 7 |