- flavours compartmentalised

Took 10 hours 11 minutes
This commit is contained in:
2023-03-28 21:38:33 +01:00
parent f87d986849
commit 16433d0852
130 changed files with 814 additions and 706 deletions

View File

@@ -14,6 +14,11 @@ orbs:
jobs:
# Below is the definition of your job to build and test your app, you can rename and customize it as you want.
build-and-test:
# Parameters used for determining
parameters:
flavour:
type: string
default: "Driver"
# These next lines define the Android machine image executor.
# See: https://circleci.com/docs/2.0/executor-types/
executor:
@@ -29,14 +34,13 @@ jobs:
name: Setup variables for build
command: |
echo "$GOOGLE_SERVICES_KEY" > "app/google-services.json"
# echo "$RELEASE_KEYSTORE_BASE64" | base64 --decode > "android/app/release_keystore.jks"
- run:
name: Grant execute permission for gradlew
command: |
chmod +x gradlew
# The next step will run the unit tests
- android/run-tests:
test-command: ./gradlew testDriverDebugUnitTest --continue
test-command: ./gradlew test<< parameters.flavour >>DebugUnitTest --continue
# Install Firebase tools needed for firebase emulator
- run:
name: Install firebase tools
@@ -50,15 +54,10 @@ jobs:
background: true
# Then start the emulator and run the Instrumentation tests!
- android/start-emulator-and-run-tests:
post-emulator-launch-assemble-command: ./gradlew assembleDriverDebugAndroidTest
test-command: ./gradlew connectedDriverDebugAndroidTest
post-emulator-launch-assemble-command: ./gradlew assemble<< parameters.flavour >>DebugAndroidTest
test-command: ./gradlew connected<< parameters.flavour >>DebugAndroidTest
system-image: system-images;android-25;google_apis;x86
# And finally run the release build
# - run:
# name: Assemble release build
# command: |
# ./gradlew assembleDriverRelease
# Then publish the artifacts of the Instrumentation tests!
# store test reports
- store_artifacts:
path: app/build/reports/androidTests/connected
destination: reports
@@ -74,11 +73,58 @@ jobs:
# Then publish the results of the Instrumentation tests!
- store_test_results:
path: app/build/outputs/androidTest-results/connected
# Assemble
assemble-and-release:
# Parameters used for determining
parameters:
flavour:
type: string
default: ""
executor:
name: android/android-machine
steps:
- run:
name: Setup variables for release
command: |
echo "$RELEASE_KEYSTORE_BASE64" | base64 --decode > "android/app/release_keystore.jks"
echo "$GOOGLE_PLAY_KEY" > "android/playstore.json"
# And finally run the release build
- run:
name: Assemble release build
command: |
./gradlew assembleDriverRelease
# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
version: 2
all-branch:
jobs:
- build-and-test
- build-and-test:
flavour: Driver
filters:
branches:
ignore:
- main_driver
- main_admin
release-driver:
jobs:
- build-and-test:
flavour: Driver
- assemble-and-release:
flavour: "Driver"
filters:
branches:
only: main_driver
requires:
- build-and-test
release-admin:
jobs:
- build-and-test:
flavour: Admin
- assemble-and-release:
flavour: Admin
filters:
branches:
only: main_admin
requires:
- build-and-test