Skip to content

Remove setup gradle github action usage #366

Remove setup gradle github action usage

Remove setup gradle github action usage #366

Workflow file for this run

name: Unit Test
on:
pull_request:
workflow_dispatch:
jobs:
unit-tests:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- name: 🔍 Detect Gradle Version And Cache
id: gradle-cache
uses: actions/github-script@v7
with:
script: |
const gradleCacheDetectorScriptPath = '/./.github/scripts/gradle-version-cache-detector.js'
const gradleCacheDetectorScript = require(`${process.env.GITHUB_WORKSPACE}${gradleCacheDetectorScriptPath}`)
await gradleCacheDetectorScript();
- name: Fetch gradle cache
uses: actions/cache@v4
with:
path: ${{ steps.gradle-cache.outputs['cache-paths'] }}
key: ${{ steps.gradle-cache.outputs['cache-key'] }}
- name: Run unit tests
run: ./gradlew testDebugUnitTest --continue
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ github.event_name == 'pull_request' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: Unit Test Results
junit_files: '**/test-results/**/*.xml'