chore: java 24 #19808
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
| # SPDX-FileCopyrightText: 2022-2025 Nextcloud GmbH and contributors | |
| # SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only | |
| name: Unit tests | |
| on: | |
| pull_request: | |
| branches: [ master, stable-* ] | |
| push: | |
| branches: [ master, stable-* ] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: unit-tests-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Set up JDK 24 | |
| uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 | |
| with: | |
| distribution: "temurin" | |
| java-version: 24 | |
| - name: Delete old comments | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| if: ${{ always() }} | |
| run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}} | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| - name: Run unit tests with coverage | |
| run: ./gradlew jacocoTestGplayDebugUnitTest | |
| - name: Upload failing results | |
| if: ${{ failure() }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "test" "Unit" ${{github.event.number}} | |
| - name: Upload coverage to codecov | |
| uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: unit | |
| fail_ci_if_error: true | |
| files: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/jacoco.xml | |
| - name: Upload jacoco artifacts | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: test-results | |
| path: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/html/ |