Running the unit tests of a modularized app in parallel Workflows utilizing Pipelines.
This Pipeline contains two Workflows which are executed in parallel:
unit_test_app
: This Workflow runs the unit tests of theapp
module using theandroid-unit-test
Step.unit_test_library
: This Workflow runs the unit tests of thelib-example
module using theandroid-unit-test
Step.
To test this configuration in a new Bitrise example project, do the following:
- Visit the Create New App page to create a new App.
- When prompted to select a git repository, choose Other/Manual and paste the sample project repository URL (
https://github.com/bitrise-io/Bitrise-Android-Modules-Sample.git
) in the Git repository (clone) URL field. - Confirm that this is a public repository in the resulting pop-up.
- Select the
main
branch to scan. - Wait for the project scanner to complete.
- Enter
app
as the specified module. - Enter
debug
as the specified variant. - Continue through the prompts as normal — no changes are needed.
- Open the new Bitrise project’s Workflow Editor.
- Go to the bitrise.yml tab, and replace the existing yaml contents with the contents of the example
bitrise.yml
below. - Click the Start/Schedule a Build button, and select the
pipeline_unit_test
option in the Workflow, Pipeline dropdown menu at the bottom of the popup.
format_version: "17"
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
meta:
bitrise.io:
stack: linux-docker-android-22.04
machine_type_id: standard
pipelines:
pipeline_unit_test:
workflows:
unit_test_app: {}
unit_test_library: {}
workflows:
unit_test_app:
envs:
- MODULE: app
- VARIANT: debug
after_run:
- _test
unit_test_library:
envs:
- MODULE: lib-example
after_run:
- _test
_test:
steps:
- git-clone@8: {}
- android-unit-test@1:
inputs:
- module: $MODULE
- variant: $VARIANT