-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (52 loc) · 2.14 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
name: Android CI
on:
push:
branches:
- develop
- main
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Cancel Workflow Action
uses: styfle/[email protected]
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ secrets.ANDROID_CI_GITHUB_TOKEN }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Configure Android SDK
run: sdkmanager "build-tools;33.0.0" "platforms;android-33"
- name: Validating Gradle wrapper checksum
uses: gradle/wrapper-validation-action@v1
- run: chmod +x ./gradlew
- name: Format code
uses: gradle/gradle-build-action@v2
with:
arguments: formatKotlin
- id: commit_formatted_code
name: Commit formatted code
uses: EndBug/add-and-commit@v9
with:
message: Format code
default_author: github_actions
add: "*.kt"
- name: Cancelling due to formatted code
uses: andymckay/[email protected]
if: steps.commit_formatted_code.outputs.pushed == 'true'
- name: Run validations
uses: gradle/gradle-build-action@v2
id: gradle
with:
arguments: lintKotlin :app:assembleDebug :app:lintDebug --stacktrace # run tests here
if: steps.commit_formatted_code.outputs.pushed == 'false'