Skip to content

Commit

Permalink
Merge pull request #6 from asadmansr/feature/added-example
Browse files Browse the repository at this point in the history
Added example section in the readme and updated readme to display ver…
  • Loading branch information
asadmansr authored Mar 21, 2020
2 parents 6821678 + 22be0a5 commit ffac4cf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Android Test Report Action

[![Release](https://img.shields.io/github/release/asadmansr/android-test-report-action.svg)](https://github.com/asadmansr/android-test-report-action/releases)
[![Marketplace](https://img.shields.io/badge/GitHub-Marketplace-orange.svg)](https://github.com/marketplace/actions/android-test-report-action)

GitHub Action that prints Android test xml reports.

## Usage
Expand All @@ -10,7 +14,9 @@ name: Android CI
on: [push]

jobs:
# Execute unit testing command
#####################################
# Test job to run Android unit tests
#####################################
test:
runs-on: ubuntu-latest
steps:
Expand All @@ -23,12 +29,22 @@ jobs:

- name: Unit Test
run: ./gradlew testDebugUnitTest
continue-on-error: true # Allow steps to continue even with test failures
continue-on-error: true # IMPORTANT: allow pipeline to continue to Android Test Report step

- name: Report
uses: asadmansr/android-test-report-action@master
- name: Android Test Report
uses: asadmansr/android-test-report-action@v1.1.0
```
#### Note
To use this Action, create a test job in the workflow. As a step, execute the unit test command using gradle. Make sure to include `continue-on-error` to prevent the job failing prior to displaying the error. Then, use the Android Test Report Action to display the reports. The Action will automatically pass or fail the job depending on the test results.

## Output

![action](./images/action.png)
![action](./images/output.png)

## Example

To learn how to use this Action in an Android application, check out the following example repository:
https://github.com/asadmansr/android-test-report-action-example

- master branch: Passed pipeline as all the tests passed
- failed-pipeline branch: Failed pipeline as some of the tests failed
Binary file removed images/action.png
Binary file not shown.
Binary file added images/output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ffac4cf

Please sign in to comment.