-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (87 loc) · 3.59 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
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@v4
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 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Configure Android SDK
run: sdkmanager "build-tools;34.0.0" "platforms;android-34"
- name: Validating Gradle wrapper checksum
uses: gradle/wrapper-validation-action@v1
- 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 lintDebug :app:assembleDebug --stacktrace # run tests here
if: steps.commit_formatted_code.outputs.pushed == 'false'
- uses: github/codeql-action/upload-sarif@v3
if: steps.commit_formatted_code.outputs.pushed == 'false' && success() || failure()
with:
sarif_file: app/build/reports/lint-results-debug.sarif
category: lint
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: reviewdog/action-actionlint@v1
detekt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Detekt
uses: alaegin/[email protected]
with:
github_token: ${{ secrets.github_token }}
detekt_config: ./config/detekt/detekt.yml
reviewdog_filter: file # always analyse whole file that was added/modified
modulecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Validating Gradle wrapper checksum
uses: gradle/wrapper-validation-action@v1
- name: Check modules
uses: gradle/gradle-build-action@v2
continue-on-error: true
with:
arguments: moduleCheck --no-daemon