image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest" stages: - update - qa - build - test # By default load dev keys. variables: MAPBOX_KEY: $MAPBOX_KEY_DEV SENTRY_DSN: $SENTRY_DSN workflow: rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"' when: never - if: '$CI_COMMIT_BRANCH' before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew cache: key: ${CI_PROJECT_ID} paths: - .gradle/ nightly-tasks: stage: update script: - ./gradlew dependencyUpdates rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' artifacts: paths: - build/dependencyUpdates quality-analysis: stage: qa script: - ./gradlew spotlessCheck lint rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - if: '$CI_COMMIT_BRANCH == "main"' when: never - if: '$CI_COMMIT_REF_PROTECTED == "true"' when: never - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never - when: always build-debug: stage: build script: - ./gradlew :app:assembleDebug rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - if: '$CI_COMMIT_BRANCH == "main"' when: never - if: '$CI_COMMIT_REF_PROTECTED == "true"' when: never - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never - when: on_success artifacts: paths: - app/build/outputs/apk test-debug: stage: test script: - ./gradlew test --stacktrace rules: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: never - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"' when: always - if: '$CI_COMMIT_BRANCH == "main"' when: never - if: '$CI_COMMIT_REF_PROTECTED == "true"' when: never - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: never - when: on_success artifacts: paths: - ./**/build/reports/tests/testDebugUnitTest build-e-release: stage: build script: - ./gradlew :app:assembleERelease rules: - if: '$CI_COMMIT_REF_PROTECTED == "true" && $CI_BUILD_TAG =~ /^eOS-/' variables: MAPBOX_KEY: $MAPBOX_KEY_PROD when: always - when: never artifacts: paths: - app/build/outputs/apk - app/build/reports