-
Notifications
You must be signed in to change notification settings - Fork 9
129 lines (125 loc) · 4.66 KB
/
task_for_library_update.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
124
125
126
127
128
129
name: Task for library update
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
branches:
- develop
paths:
- 'gradle/libs.versions.toml'
- 'build.gradle'
jobs:
upload_dependency_list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Decode google-services.json
env:
GOOGLE_SERVICE: ${{ secrets.GOOGLE_SERVICE}}
run: echo $GOOGLE_SERVICE | base64 --decode > ./app/google-services.json
- name: Create dependency list
env:
TZ: Asia/Tokyo
run: ./gradlew app:dependencies > depend.txt
- uses: actions/upload-artifact@v4
with:
name: Dependency list
path: depend.txt
android_test:
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
api-level:
- 30
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Decode google-services.json
env:
GOOGLE_SERVICE: ${{ secrets.GOOGLE_SERVICE}}
run: echo $GOOGLE_SERVICE | base64 --decode > ./app/google-services.json
- name: Replace Admob ID
env:
ADMOB_ID_MYCURATION: ${{ secrets.ADMOB_ID_MYCURATION }}
run: mkdir -p ~/.gradle && touch ~/.gradle/gradle.properties && echo ADMOB_ID_MYCURATION=$ADMOB_ID_MYCURATION > ~/.gradle/gradle.properties
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Build AndroidTest apps
run: ./gradlew packageDebug packageDebugAndroidTest --daemon
- name: Run androidTest
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: x86_64
disable-animations: true
disk-size: 6000M
heap-size: 600M
emulator-boot-timeout: 12000
ram-size: 4096M
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: ./gradlew :app:connectedDebugAndroidTest --daemon
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/build/outputs/androidTest-results/connected//TEST-*.xml'
check_name: 'androidTest Report'
dependency_diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- id: dependency-diff
name: Generate dependency diff
run: |
BRANCH_NAME="${GITHUB_HEAD_REF}"
DIFF=$(scripts/dependency_diff.sh $BASE_BRANCH $BRANCH_NAME app releaseRuntimeClasspath)
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "text-diff<<${EOF}" >> $GITHUB_OUTPUT
echo "${DIFF}" >> $GITHUB_OUTPUT
echo "${EOF}" >> $GITHUB_OUTPUT
env:
BASE_BRANCH: ${{ github.base_ref }}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: peter-evans/find-comment@b80e3f1127f9f13a42d50c0fc404ed367091084f
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Dependency diff
- uses: peter-evans/create-or-update-comment@71ac479718f8aed504782bc920d802da994c05fa
if: ${{ steps.dependency-diff.outputs.text-diff != null || steps.find_comment.outputs.comment-id != null }}
with:
body: |
Dependency diff:
```diff
${{ steps.dependency-diff.outputs.text-diff }}
```
edit-mode: replace
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}