-
Notifications
You must be signed in to change notification settings - Fork 4
113 lines (104 loc) · 3.19 KB
/
android.yaml
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
name: Android CI
on:
push:
branches: [ "develop" ]
pull_request:
types: [opened, synchronize, ready_for_review, edited]
branches: [ "develop", "refactor**", "fix**", "feat**", "feature**", "chore**", "test**" ]
jobs:
spotless_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: add local.properties
run: |
echo api.key=\"${{secrets.API_KEY}}\" > local.properties
- name: Cache Gradle Packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Spotless Check
run: ./gradlew spotlessCheck
spotless_apply:
needs: spotless_check
if: ${{ failure() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: add local.properties
run: |
echo api.key=\"${{secrets.API_KEY}}\" > local.properties
- name: Cache Gradle Packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: set git config
if: ${{ success() }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
git remote update
git fetch
git checkout origin/$GITHUB_HEAD_REF
- name: Spotless Apply
run: ./gradlew spotlessApply
- name: git commit and push
if: ${{ success() }}
run: |
git add .
git commit -m "Apply Spotless formatting"
git push origin HEAD:$GITHUB_HEAD_REF
build:
runs-on: ubuntu-latest
needs: spotless_check
if: ${{ success() }}
steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: add local.properties
run: |
echo api.key=\"${{secrets.API_KEY}}\" > local.properties
- name: Cache Gradle Packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew app:assembleDebug