mirror of
https://github.com/Matte23/circolapp.git
synced 2025-12-06 07:29:10 +00:00
Add Android Lint to Github Actions
This commit is contained in:
36
.github/workflows/ci.yml
vendored
36
.github/workflows/ci.yml
vendored
@@ -1,7 +1,5 @@
|
|||||||
name: Android CI
|
name: Android CI
|
||||||
|
|
||||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
|
||||||
# events but only for the master branch
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
@@ -10,11 +8,9 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
# The type of runner that the job will run on
|
|
||||||
name: Run Unit Tests
|
name: Run Unit Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Setup Java JDK
|
- name: Setup Java JDK
|
||||||
@@ -22,9 +18,33 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 1.8
|
||||||
- name: Unit tests
|
- name: Unit tests
|
||||||
run: bash ./gradlew test --stacktrace
|
run: bash ./gradlew test
|
||||||
- name: Kotlin Linter
|
|
||||||
uses: vroy/gha-kotlin-linter@v2
|
lint:
|
||||||
|
name: Run Android Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup Java JDK
|
||||||
|
uses: actions/setup-java@v1.4.2
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
- name: Run Android Lint
|
||||||
|
run: bash ./gradlew lint
|
||||||
|
|
||||||
|
ktlint:
|
||||||
|
name: Run Kotlin Lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup Java JDK
|
||||||
|
uses: actions/setup-java@v1.4.2
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
- name: Run Kotlin Lint
|
||||||
|
run: bash ./gradlew ktlintCheck
|
||||||
|
|
||||||
apk:
|
apk:
|
||||||
name: Generate APK
|
name: Generate APK
|
||||||
@@ -37,7 +57,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 1.8
|
||||||
- name: Build debug APK
|
- name: Build debug APK
|
||||||
run: bash ./gradlew assembleDebug --stacktrace
|
run: bash ./gradlew assembleDebug
|
||||||
- name: Upload APK
|
- name: Upload APK
|
||||||
uses: actions/upload-artifact@v1
|
uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
maven {
|
||||||
|
url "https://plugins.gradle.org/m2/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$about_libs_version"
|
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$about_libs_version"
|
||||||
|
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.4.0"
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
@@ -21,8 +24,9 @@ allprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
|||||||
Reference in New Issue
Block a user