unit-tests.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: MIT
  3. name: Unit tests
  4. on:
  5. pull_request:
  6. branches: [ master, main, stable-* ]
  7. push:
  8. branches: [ master, main, stable-* ]
  9. permissions:
  10. contents: read
  11. pull-requests: write
  12. concurrency:
  13. group: unit-tests-${{ github.head_ref || github.run_id }}
  14. cancel-in-progress: true
  15. jobs:
  16. test:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
  20. - name: Set up JDK 17
  21. uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
  22. with:
  23. distribution: "temurin"
  24. java-version: 17
  25. - name: Run unit tests with coverage
  26. uses: gradle/gradle-build-action@ac2d340dc04d9e1113182899e983b5400c17cda1 # v3.5.0
  27. with:
  28. arguments: testGplayDebugUnit
  29. - name: Upload test artifacts
  30. if: ${{ failure() }}
  31. uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
  32. with:
  33. name: test-results
  34. path: app/build/reports/tests/testGplayDebugUnitTest/