From 8068afa9f8cd45bef6f326f2cef09cf9efaefd49 Mon Sep 17 00:00:00 2001 From: Marc Plano-Lesay Date: Fri, 11 Aug 2023 07:32:18 +1000 Subject: [PATCH] Set up a basic CI pipeline --- .gitlab-ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++++ app/build.gradle.kts | 4 ++++ lint-config.xml | 7 +++++++ 3 files changed, 53 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 lint-config.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..7a6bf3d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,42 @@ +image: mobiledevops/android-sdk-image:33.0.2 + +stages: + - check + - build + - test + +cache: + - key: $CI_PROJECT_ID-$CI_COMMIT_REF_SLUG + fallback_keys: + - $CI_PROJECT_ID-$CI_DEFAULT_BRANCH + - $CI_PROJECT_ID-default + paths: + - .gradle/caches + - .gradle/wrapper + +before_script: + - export GRADLE_USER_HOME=$PWD/.gradle + +lintDebug: + stage: check + script: + - ./gradlew --console=plain :app:lintDebug + artifacts: + paths: + - app/build/reports/lint-results-debug.html + expose_as: "lint-report" + when: always + +assembleDebug: + interruptible: true + stage: build + script: + - ./gradlew --console=plain assembleDebug + artifacts: + paths: + - app/build/outputs/ + +testDebug: + stage: test + script: + - ./gradlew --console=plain test \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6fe4154..efcb86a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -83,6 +83,10 @@ android { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } + + lint { + lintConfig = file("$rootDir/lint-config.xml") + } } dependencies { diff --git a/lint-config.xml b/lint-config.xml new file mode 100644 index 0000000..3576b9d --- /dev/null +++ b/lint-config.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file