From 75de13980f7ebb94e916f96d708c5d31677fdc20 Mon Sep 17 00:00:00 2001 From: ITQ Date: Sat, 22 Nov 2025 01:59:22 +0300 Subject: [PATCH] feat: added CI --- .gitlab-ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..c55c00e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,46 @@ +image: docker.io/eclipse-temurin:21 + +stages: + - build + - test + +cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - .gradle/ + - $HOME/Android/ + +before_script: + - apt-get update -y + - apt-get install -y wget unzip git + - wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip -O cmdline-tools.zip + - mkdir -p $HOME/Android/cmdline-tools + - unzip cmdline-tools.zip -d $HOME/Android/cmdline-tools + - yes | $HOME/Android/cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/Android "platform-tools" "platforms;android-33" "build-tools;33.0.2" + - export ANDROID_HOME=$HOME/Android + - export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH + +build: + stage: build + script: + - ./gradlew assembleDebug + artifacts: + paths: + - app/build/outputs/apk/debug/*.apk + expire_in: 1 week + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + +test: + stage: test + script: + - ./gradlew test + artifacts: + paths: + - app/build/test-results/test/*.xml + - app/build/reports/tests/test/*.html + expire_in: 1 week + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_PIPELINE_SOURCE == 'merge_request_event'