-
Notifications
You must be signed in to change notification settings - Fork 7
36 lines (33 loc) · 1.42 KB
/
lint-gradle-files.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: "Lint build.gradle files"
on:
push:
branches: [ develop, main ]
paths: [ '**.gradle' ]
# Allow manual triggering
workflow_dispatch:
jobs:
lint-gradle-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Java"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
# "When using gradle-build-action we recommend that you
# not use actions/cache or actions/setup-java@v4 to explicitly
# cache the Gradle User Home"
# cache: 'gradle'
- name: "Setup Gradle"
uses: gradle/actions/setup-gradle@v3
with:
# Only write to the cache for builds on the 'main' and 'develop' branches. (Default is 'main' only.)
# Builds on other branches will only read existing entries from the cache.
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/qa' && github.ref != 'refs/heads/develop' }}
# To avoid a growing cache over time, attempt to delete any files in the Gradle User Home
# that were not used by Gradle during the workflow, prior to saving the cache.
# https://github.com/gradle/actions/setup-gradle@v3#removing-unused-files-from-gradle-user-home-before-saving-to-cache
gradle-home-cache-cleanup: true
- name: "Lint Gradle files"
run: ./gradlew lintGradle