https://github.com/bitrise-steplib/bitrise-step-android-build-for-ui-testing
https://github.com/bitrise-steplib/bitrise-step-android-build-for-ui-testing
bitrise bitrise-step ci production-code
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitrise-steplib/bitrise-step-android-build-for-ui-testing
- Owner: bitrise-steplib
- License: mit
- Created: 2019-01-07T16:02:05.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-18T08:20:59.000Z (about 2 years ago)
- Last Synced: 2025-03-24T07:51:56.375Z (7 months ago)
- Topics: bitrise, bitrise-step, ci, production-code
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 6
- Watchers: 9
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Build for UI Testing
[](https://github.com/bitrise-steplib/bitrise-step-android-build-for-ui-testing/releases)
Builds your Android project with Gradle with the belonging AndroidTest variant.
Description
[This Step](https://github.com/bitrise-steplib/bitrise-step-android-build-for-ui-testing) generates all the APKs you need to run instrumentation tests for your Android app: both an APK from your app and the belonging test APK, for example, `:app:assembleDemoDebug`, `:app:assembleDemoDebugAndroidTest`
### Configuring the Step
1. Add the **Project Location** which is the root directory of your Android project.
2. Set the **Module** you want to build. To see your available modules, open your project in Android Studio and go to **Project Structure** and see the list on the left.
3. Set the **Variant** you want to build. To see your available variants, open your project in Android Studio and go to **Project Structure** and then the **variants** section.
Under **Options**:
4. Set the **APK location pattern**: Once the build has run, the Step finds the APK files with the given pattern.
5. **Set the level of cache** where `all` caches build cache and dependencies, `only_deps` caches dependencies only, `none` does not cache anything.
6. If you wish to pass any extra Gradle arguments to the gradle task, you can add those in the **Additional Gradle Arguments** input.### Useful links
- [Testing with Bitrise](https://devcenter.bitrise.io/testing/testing-index/)
- [Deploying an Android app with Bitrise](https://devcenter.bitrise.io/deploy/android-deploy/android-deployment-index/)### Related Steps
- [Android Build](https://www.bitrise.io/integrations/steps/android-build)
- [Gradle Runner](https://www.bitrise.io/integrations/steps/gradle-runner)## 🧩 Get started
Add this step directly to your workflow in the [Bitrise Workflow Editor](https://devcenter.bitrise.io/steps-and-workflows/steps-and-workflows-index/).
You can also run this step directly with [Bitrise CLI](https://github.com/bitrise-io/bitrise).
## ⚙️ Configuration
Inputs
| Key | Description | Flags | Default |
| --- | --- | --- | --- |
| `project_location` | The root directory of your android project, for example, where your root build gradle file exist (also gradlew, settings.gradle, etc...) | required | `$BITRISE_SOURCE_DIR` |
| `module` | Set the module to build. Valid syntax examples: `app`, `feature:nested-module` To see your available modules please open your project in Android Studio and go in [Project Structure] and see the list on the left. | required | |
| `variant` | Set the variant that you want to build. To see your available variants please open your project in Android Studio and go in [Project Structure] -> variants section. | required | |
| `apk_path_pattern` | Will find the APK files with the given pattern. | required | `*/build/outputs/apk/*.apk` |
| `cache_level` | `all` - will cache build cache and dependencies `only_deps` - will cache dependencies only `none` - will not cache anything | required | `only_deps` |
| `arguments` | Extra arguments passed to the gradle task | | |Outputs
| Environment Variable | Description |
| --- | --- |
| `BITRISE_APK_PATH` | This output will include the path of the generated APK after filtering based on the filter inputs. |
| `BITRISE_TEST_APK_PATH` | This output will include the path of the generated test APK after filtering based on the filter inputs. |## 🙋 Contributing
We welcome [pull requests](https://github.com/bitrise-steplib/bitrise-step-android-build-for-ui-testing/pulls) and [issues](https://github.com/bitrise-steplib/bitrise-step-android-build-for-ui-testing/issues) against this repository.
For pull requests, work on your changes in a forked repository and use the Bitrise CLI to [run step tests locally](https://devcenter.bitrise.io/bitrise-cli/run-your-first-build/).
Learn more about developing steps:
- [Create your own step](https://devcenter.bitrise.io/contributors/create-your-own-step/)
- [Testing your Step](https://devcenter.bitrise.io/contributors/testing-and-versioning-your-steps/)