mirror of
https://github.com/NiciDieNase/chaosflix
synced 2025-02-17 05:28:24 +00:00
97 lines
No EOL
3.8 KiB
YAML
97 lines
No EOL
3.8 KiB
YAML
version: 2
|
|
jobs:
|
|
build:
|
|
working_directory: ~/code
|
|
docker:
|
|
- image: circleci/android:api-28
|
|
environment:
|
|
JVM_OPTS: -XX\:MaxHeapSize\=2048m -Xmx1536m
|
|
FLAVOR1: Prod
|
|
FLAVOR2: NoFree
|
|
BUILD_TYPE: Release
|
|
branches:
|
|
only:
|
|
- circleCI
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }}
|
|
- run:
|
|
name: Setup env
|
|
command: |
|
|
echo "export BUILD_TYPE_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${BUILD_TYPE:0:1}${BUILD_TYPE:1})\"" >> $BASH_ENV
|
|
echo "export FLAVOR1_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${FLAVOR1:0:1}${FLAVOR1:1})\"" >> $BASH_ENV
|
|
echo "export FLAVOR2_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${FLAVOR2:0:1}${FLAVOR2:1})\"" >> $BASH_ENV
|
|
echo "$ENCODED_KEYSTORE" | base64 --decode >> ${HOME}/code/keystore.jks
|
|
echo 'export KEYSTORE=${HOME}/code/keystore.jks' >> $BASH_ENV
|
|
echo "export SIGN_CONFIG=\"-PchaosflixKeystore=$KEYSTORE -PchaosflixStorePassword=$KEYSTORE_PASSWORD -PchaosflixKeyName=$KEY_NAME -PchaosflixKeyPassword=$KEYSTORE_PASSWORD\""
|
|
- run:
|
|
name: Download Dependencies
|
|
command: ./gradlew androidDependencies
|
|
- run:
|
|
name: Build Touch
|
|
command: |
|
|
./gradlew \
|
|
-PchaosflixKeystore=$KEYSTORE\
|
|
-PchaosflixStorePassword=$KEYSTORE_PASSWORD\
|
|
-PchaosflixKeyName=$KEY_NAME\
|
|
-PchaosflixKeyPassword=$KEYSTORE_PASSWORD\
|
|
touch:assemble$FLAVOR1_LOWER$FLAVOR2$BUILD_TYPE
|
|
# touch:build
|
|
- run:
|
|
name: Build Leanback
|
|
command: |
|
|
./gradlew \
|
|
-PchaosflixKeystore=$KEYSTORE\
|
|
-PchaosflixStorePassword=$KEYSTORE_PASSWORD\
|
|
-PchaosflixKeyName=$KEY_NAME\
|
|
-PchaosflixKeyPassword=$KEYSTORE_PASSWORD\
|
|
leanback:assemble$FLAVOR1_LOWER$BUILD_TYPE
|
|
# leanback:build
|
|
- store_artifacts:
|
|
path: common/build/outputs
|
|
destination: common-reports
|
|
- store_artifacts:
|
|
path: touch/build/outputs
|
|
destination: touch
|
|
- store_artifacts:
|
|
path: touch/build/outputs
|
|
destination: touch-reports
|
|
- store_artifacts:
|
|
path: leanback/build/outputs
|
|
destination: leanback
|
|
- store_artifacts:
|
|
path: leanback/build/reports
|
|
destination: leanback-reports
|
|
- run:
|
|
name: Test
|
|
command: |
|
|
./gradlew \
|
|
--continue \
|
|
common:test$FLAVOR1${BUILD_TYPE}UnitTest \
|
|
common:lint$FLAVOR1$BUILD_TYPE \
|
|
touch:test$FLAVOR1$FLAVOR2${BUILD_TYPE}UnitTest \
|
|
touch:lint$FLAVOR1$FLAVOR2$BUILD_TYPE \
|
|
leanback:test$FLAVOR1${BUILD_TYPE}UnitTest \
|
|
leanback:lint$FLAVOR1$BUILD_TYPE
|
|
- run:
|
|
name: ktlint
|
|
command:
|
|
./gradlew \
|
|
--continue \
|
|
common:ktlint$FLAVOR1$BUILD_TYPEcheck \
|
|
touch:ktlint$FLAVOR1$FLAVOR2$BUILD_TYPEcheck \
|
|
leanback:ktlint$FLAVOR1$BUILD_TYPEcheck
|
|
- store_artifacts:
|
|
path: common/build/reports/ktlint/
|
|
destination: ktlint-reports
|
|
- store_test_results:
|
|
path: common/build/test-results
|
|
- store_test_results:
|
|
path: touch/build/test-results
|
|
- store_test_results:
|
|
path: leanback/build/test-results
|
|
- save_cache:
|
|
paths:
|
|
- ~/.gradle
|
|
key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }} |