-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (72 loc) · 1.98 KB
/
lint.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
name: Lint
on:
pull_request:
merge_group:
types: [checks_requested]
push:
branches: [ main ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Check for Android changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
android: ${{ steps.filter.outputs.android }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
android:
- 'android/**'
- '.github/**'
lint:
name: ktlint & gradle lint
needs: changes
if: ${{ needs.changes.outputs.android == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run ktlint
run: |
cd android
./gradlew lint lintKotlin :build-logic:convention:lint --continue
detekt:
name: Detekt
needs: changes
if: ${{ needs.changes.outputs.android == 'true' }}
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Run detekt
run: |
cd android
./gradlew detektDebug --continue
- name: Upload SARIF report for code scanning report
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: android/build/reports/detekt/merge.sarif
# Used to differentiate multiple results for one commit
category: detekt