Skip to content

Commit 810caa2

Browse files
authored
chore: added Lint report (#132)
* chore: added Lint report * chore: added lin to shared module
1 parent 06cddb6 commit 810caa2

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed

.github/workflows/lint-report.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Lint and Upload SARIF
16+
17+
on:
18+
push:
19+
branches:
20+
- main
21+
pull_request:
22+
branches:
23+
- main
24+
25+
jobs:
26+
lint:
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v3
32+
33+
- name: Set up JDK 17
34+
uses: actions/setup-java@v3
35+
with:
36+
distribution: 'adopt'
37+
java-version: '17'
38+
39+
- name: Run Android Lint
40+
run: ./gradlew lint
41+
42+
- name: Merge SARIF files
43+
run: |
44+
jq -s '{ "$schema": "https://json.schemastore.org/sarif-2.1.0", "version": "2.1.0", "runs": map(.runs) | add }' shared/build/reports/lint-results.sarif places-rx/build/reports/lint-results.sarif maps-rx/build/reports/lint-results.sarif app/build/reports/lint-results.sarif > merged.sarif
45+
46+
- name: Upload SARIF file
47+
uses: github/codeql-action/upload-sarif@v3
48+
with:
49+
sarif_file: merged.sarif

app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ plugins {
55
}
66

77
android {
8+
lint {
9+
sarifOutput = file("$buildDir/reports/lint-results.sarif")
10+
}
11+
812
buildFeatures {
913
buildConfig = true
1014
}

maps-rx/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
android {
2+
lint {
3+
sarifOutput = file("$buildDir/reports/lint-results.sarif")
4+
}
5+
26
namespace = "com.google.maps.android.rx.maps"
37

48
compileSdk 34

places-rx/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
android {
2+
lint {
3+
sarifOutput = file("$buildDir/reports/lint-results.sarif")
4+
}
5+
26
namespace = "com.google.maps.android.rx.places"
37

48
compileSdk 34

shared/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ plugins {
44
}
55

66
android {
7+
lint {
8+
sarifOutput = file("$buildDir/reports/lint-results.sarif")
9+
}
710
namespace = "com.google.maps.android.rx.shared"
811

912
compileSdk 34

0 commit comments

Comments
 (0)