-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (103 loc) · 3.94 KB
/
dependencyGraph.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Generate Dependency Graph
on:
pull_request:
types:
- opened
jobs:
build:
name: PR Checker
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with :
persist-credentials: false
fetch-depth: 0
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Change gradlew permissions
run: chmod +x ./gradlew
- name: Touch lgtm properties
run: touch lgtm.properties
- name: Access LGTM_BASE_URL_DEBUG
env:
LGTM_BASE_URL_DEBUG: ${{ secrets.LGTM_BASE_URL_DEBUG }}
run: echo "LGTM_BASE_URL_DEBUG=\"$LGTM_BASE_URL_DEBUG\"" >> lgtm.properties
- name: Access LGTM_BASE_URL_RELEASE
env:
LGTM_BASE_URL_RELEASE: ${{ secrets.LGTM_BASE_URL_RELEASE }}
run: echo "LGTM_BASE_URL_RELEASE=\"$LGTM_BASE_URL_RELEASE\"" >> lgtm.properties
- name: Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Change gradlew permissions
run: chmod +x ./gradlew
- name: Touch lgtm properties
run: touch lgtm.properties
- name: Access LGTM_BASE_URL_DEBUG
env:
LGTM_BASE_URL_DEBUG: ${{ secrets.LGTM_BASE_URL_DEBUG }}
run: echo "LGTM_BASE_URL_DEBUG=\"$LGTM_BASE_URL_DEBUG\"" >> lgtm.properties
- name: Access LGTM_BASE_URL_RELEASE
env:
LGTM_BASE_URL_RELEASE: ${{ secrets.LGTM_BASE_URL_RELEASE }}
run: echo "LGTM_BASE_URL_RELEASE=\"$LGTM_BASE_URL_RELEASE\"" >> lgtm.properties
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Generate Dependency Graph
run: ./gradlew projectDependencyGraph --stacktrace
- name: Commit
run: |
git config --local user.email '[email protected]'
git config --local user.name 'GitHub Action'
git diff --quiet && git diff --staged --quiet || git commit -am '[DOCS] Update dependency graph'
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.TOKEN_GITHUB }}
branch: ${{ github.head_ref }}
- name: On Success!! Congratulations
if: ${{ success() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: '#53A551'
SLACK_ICON: https://github.com/hellokitty-coding-club/LGTM-Android/assets/59546818/603efae5-02ba-4065-ba7b-ea36bc88acb6
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_TITLE: '[LGTM] Dependency graph is now up to date ✅'
MSG_MINIMAL: true
SLACK_USERNAME: LGTM-Android
SLACK_MESSAGE: 'Dependency graph has been updated to its latest state'
- name: On Failed, Notify in Slack
if: ${{ failure() }}
uses: rtCamp/action-slack-notify@v2
with:
status: ${{ job.status }}
env:
SLACK_COLOR: '#ff0000'
SLACK_ICON: https://github.com/hellokitty-coding-club/LGTM-Android/assets/59546818/603efae5-02ba-4065-ba7b-ea36bc88acb6
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_TITLE: '[LGTM] Dependency graph update has failed ❌'
MSG_MINIMAL: ref,actions url,event,commit
SLACK_USERNAME: LGTM-Android
SLACK_MESSAGE: 'The attempt to update the dependency graph has encountered an issue'