Skip to content

Commit

Permalink
Setup Android lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sdsantos committed Jul 24, 2024
1 parent 7963efc commit ac958db
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Setup'
description: 'Setup Java, checkout and setup gradle'
runs:
using: "composite"
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
48 changes: 48 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Validate
on:
push:
branches:
- master
pull_request:

jobs:
build:
name: Build
runs-on: macos-latest

strategy:
matrix:
type: [Debug, Release]

steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Build Android
run: ./gradlew assemble${{ matrix.type }}

- name: Build iOS
run: ./gradlew link${{ matrix.type }}FrameworkIosSimulatorArm64

android-lint:
name: Android Lint
runs-on: macos-latest
needs: [ build ]

steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run lint
run: ./gradlew lint

- name: Uploads test reports
uses: actions/upload-artifact@v4
if: failure()
with:
name: android-lint-report
path: composeApp/build/reports/
11 changes: 11 additions & 0 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ kotlin {
framework {
baseName = "composeApp"
isStatic = true
binaryOption("bundleId", "composeApp")
}

podfile = project.file("../iosApp/Podfile")
Expand All @@ -53,6 +54,10 @@ kotlin {
implementation(compose.components.uiToolingPreview)
implementation(libs.kotlin.serialization)
}

all {
languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}

@OptIn(ExperimentalKotlinGradlePluginApi::class)
Expand Down Expand Up @@ -96,4 +101,10 @@ android {
dependencies {
debugImplementation(libs.compose.ui.tooling)
}
android {
lint {
warningsAsErrors = true
disable += "AndroidGradlePluginVersion"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
2 changes: 1 addition & 1 deletion iosApp/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :ios, '9.0'
platform :ios, '12.0'
use_frameworks!

target 'iosApp' do
Expand Down
2 changes: 1 addition & 1 deletion iosApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ SPEC CHECKSUMS:
libz: 83658eb2a0db785623ffdf9ce13407e6b8b5c8f9
oonimkall: 9768ce9dad18265d45d2ea972c84fb0bd5237cc3

PODFILE CHECKSUM: 9f3463701e9fb15f3dded022f7afabede102208e
PODFILE CHECKSUM: 04b498ba1984c25e9816234b0551222184c25492

COCOAPODS: 1.15.2

0 comments on commit ac958db

Please sign in to comment.