Add caches to PR CI #6
Workflow file for this run
This file contains 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: Checks and Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
gradleTask: [assembleDebug testDebugUnitTest, lintDebug, ktlintCheck] | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
java-version: 21 | |
distribution: temurin | |
cache: 'gradle' | |
- name: Setup Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Check Gradle | |
uses: gradle/actions/wrapper-validation@v3 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build with Gradle | |
run: ./gradlew ${{ matrix.gradleTask }} |