-
-
Notifications
You must be signed in to change notification settings - Fork 57
68 lines (57 loc) · 2.24 KB
/
dependency_analysis.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: "Dependency Analysis"
# Run only when build.gradle file is changed
on:
workflow_dispatch:
# Allow manual triggering
# push:
# paths:
# - '**/build.gradle'
# - '**/build.gradle.kts'
# - '**/gradle.properties'
# - '**/gradle.properties.kts'
# - '**/gradle-wrapper.properties'
# - '**/gradle-wrapper.properties.kts'
# - '**/settings.gradle'
# - '**/settings.gradle.kts'
# - '**/settings.gradle.kts'
jobs:
validation:
# Skip if head commit contains 'skip da'
if: "!contains(github.event.head_commit.message, 'skip da')"
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Gradle Wrapper validation
uses: gradle/wrapper-validation-action@v1
dependencyAnalysis:
# Skip if tags
if: startsWith(github.ref , 'refs/tags/') != true
name: "Dependency Analysis"
runs-on: ubuntu-latest
needs: validation
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '17' # Adjust the Java version as needed
distribution: 'temurin'
cache: 'gradle'
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Update Gradle Wrapper to use Java 17
run: echo "org.gradle.java.home=/usr/lib/jvm/adoptopenjdk-17-hotspot-amd64" >> gradle/wrapper/gradle-wrapper.properties
- name: Cache Gradle
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Generates advice from Dependency-analysis Gradle task
run: ./gradlew buildHealth
- name: Upload advice
uses: actions/upload-artifact@v3
with:
name: dependency-advice
path: ./build/reports/dependency-analysis/