|
| 1 | +# devicecloud.dev - Trigger Mobile App Test Run |
| 2 | + |
| 3 | +This GitHub Action leverages devicecloud.dev to trigger a mobile app UI test. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +1. Navigate to the [GitHub Marketplace](https://github.com/marketplace/actions/dcd-trigger-mobile-app-test-run). |
| 8 | +2. On the action page, click `Use latest version` button. |
| 9 | +3. Follow the prompts from github to install the action. |
| 10 | + |
| 11 | +## Configuration |
| 12 | + |
| 13 | +Here is an example of how to set up the devicecloud.dev GitHub Action in your workflow file: |
| 14 | + |
| 15 | +```yaml |
| 16 | +name: devicecloud.dev Mobile App Test Run |
| 17 | +on: |
| 18 | + push: |
| 19 | + branches: [production, staging] |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - name: devicecloud.dev - Trigger Mobile App Test Run |
| 25 | + uses: devicecloud-dev/action-trigger-test-run@v1 |
| 26 | + with: |
| 27 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 28 | + app-file: path/to/build.apk |
| 29 | + workspace: path/to/workspace |
| 30 | + env: '{"VAR_1":"Some variable", "VAR_2":"A different variable"}' |
| 31 | +``` |
| 32 | +
|
| 33 | +In this example, this action will run whenever a push to the production or staging branch occurs. |
| 34 | +
|
| 35 | +### Storing Secrets |
| 36 | +
|
| 37 | +The `api-key` should be kept private. You can use GitHub secrets to protect it. To add a secret: |
| 38 | + |
| 39 | +1. Navigate to your GitHub repository and click on the `Settings` tab. |
| 40 | +2. Click on `Secrets` in the left sidebar. |
| 41 | +3. Click `New repository secret`. |
| 42 | +4. Enter `DCD_API_KEY` as the name for the secrets, and paste the corresponding key in the value field. |
| 43 | + |
| 44 | +## Inputs |
| 45 | + |
| 46 | +### `api-key` |
| 47 | + |
| 48 | +**Required** - devicecloud.dev Secret Key, find this in your devicecloud.dev dashboard. |
| 49 | +It follows the UUID schema, e.g. `85e67636-7652-45a8-94ac-e7cdd7e8f869`, however we recommend using Github Secrets for this parameter and provide as follows: |
| 50 | + |
| 51 | +```yaml |
| 52 | +--- |
| 53 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 54 | + uses: dcd-com/action-trigger-test-run@v1 |
| 55 | + with: |
| 56 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 57 | +``` |
| 58 | + |
| 59 | +### `app-file` |
| 60 | + |
| 61 | +**Required if binary-id is not specified** - App binary to run your flows against. |
| 62 | + |
| 63 | +```yaml |
| 64 | +--- |
| 65 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 66 | + uses: dcd-com/action-trigger-test-run@v1 |
| 67 | + with: |
| 68 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 69 | + app-file: /path/to/your_app.apk |
| 70 | +``` |
| 71 | + |
| 72 | +### `app-binary-id` |
| 73 | + |
| 74 | +**Required if app-file is not specified** - The ID of the app binary previously uploaded to Maestro Cloud. |
| 75 | + |
| 76 | +```yaml |
| 77 | +--- |
| 78 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 79 | + uses: dcd-com/action-trigger-test-run@v1 |
| 80 | + with: |
| 81 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 82 | + app-binary-id: your-app-binary-id |
| 83 | +``` |
| 84 | + |
| 85 | +### `workspace` |
| 86 | + |
| 87 | +**Required** - The path to the flow file or folder containing your flows. |
| 88 | + |
| 89 | +```yaml |
| 90 | +--- |
| 91 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 92 | + uses: dcd-com/action-trigger-test-run@v1 |
| 93 | + with: |
| 94 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 95 | + workspace: /path/to/flows |
| 96 | +``` |
| 97 | + |
| 98 | +### `env` |
| 99 | + |
| 100 | +**Required** - One or more environment variables to inject into your flows. The variables must be passed as stringified JSON in the form `{"VAR_1":"VAL_1","VAR_2":"VAL_2"}` |
| 101 | + |
| 102 | +```yaml |
| 103 | +--- |
| 104 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 105 | + uses: dcd-com/action-trigger-test-run@v1 |
| 106 | + with: |
| 107 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 108 | + env: '{"VAR_1":"Some variable", "VAR_2":"A different variable"}' |
| 109 | +``` |
| 110 | + |
| 111 | +### `android-api-level` |
| 112 | + |
| 113 | +**Optional** - [Android only] Android API level to run your flow against. Options: `32`, `33`, `34`. |
| 114 | + |
| 115 | +```yaml |
| 116 | +--- |
| 117 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 118 | + uses: dcd-com/action-trigger-test-run@v1 |
| 119 | + with: |
| 120 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 121 | + android-api-level: 33 |
| 122 | +``` |
| 123 | + |
| 124 | +### `android-device` |
| 125 | + |
| 126 | +**Optional** - [Android only] Android device to run your flow against. Options: `pixel-6`, `pixel-6a`, `pixel-6-pro`, `pixel-7`, `pixel-7-pro`, `generic-tablet`. |
| 127 | + |
| 128 | +```yaml |
| 129 | +--- |
| 130 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 131 | + uses: dcd-com/action-trigger-test-run@v1 |
| 132 | + with: |
| 133 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 134 | + android-device: pixel-6 |
| 135 | +``` |
| 136 | + |
| 137 | +### `async` |
| 138 | + |
| 139 | +**Optional** - Wait for the results of the run asynchronously. |
| 140 | + |
| 141 | +```yaml |
| 142 | +--- |
| 143 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 144 | + uses: dcd-com/action-trigger-test-run@v1 |
| 145 | + with: |
| 146 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 147 | + async: true |
| 148 | +``` |
| 149 | + |
| 150 | +### `exclude-flows` |
| 151 | + |
| 152 | +**Optional** - Subdirectories to ignore when building the flow file list. |
| 153 | + |
| 154 | +```yaml |
| 155 | +--- |
| 156 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 157 | + uses: dcd-com/action-trigger-test-run@v1 |
| 158 | + with: |
| 159 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 160 | + exclude-flows: 'test/exclude-directory' |
| 161 | +``` |
| 162 | + |
| 163 | +### `exclude-tags` |
| 164 | + |
| 165 | +**Optional** - Flows which have these tags will be excluded from the run. |
| 166 | + |
| 167 | +```yaml |
| 168 | +--- |
| 169 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 170 | + uses: dcd-com/action-trigger-test-run@v1 |
| 171 | + with: |
| 172 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 173 | + exclude-tags: 'tag1,tag2' |
| 174 | +``` |
| 175 | + |
| 176 | +### `google-play` |
| 177 | + |
| 178 | +**Optional** - [Android only] Run your flow against Google Play devices. |
| 179 | + |
| 180 | +```yaml |
| 181 | +--- |
| 182 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 183 | + uses: dcd-com/action-trigger-test-run@v1 |
| 184 | + with: |
| 185 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 186 | + google-play: true |
| 187 | +``` |
| 188 | + |
| 189 | +### `include-tags` |
| 190 | + |
| 191 | +**Optional** - Only flows which have these tags will be included in the run. |
| 192 | + |
| 193 | +```yaml |
| 194 | +--- |
| 195 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 196 | + uses: dcd-com/action-trigger-test-run@v1 |
| 197 | + with: |
| 198 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 199 | + include-tags: 'tag3,tag4' |
| 200 | +``` |
| 201 | + |
| 202 | +### `ios-device` |
| 203 | + |
| 204 | +**Optional** - [iOS only] iOS device to run your flow against. Options: `iphone-12`, `iphone-12-mini`, `iphone-12-pro-max`, `iphone-13`, `iphone-13-mini`, `iphone-13-pro-max`, `iphone-14`, `iphone-14-plus`, `iphone-14-pro`, `iphone-14-pro-max`, `iphone-15`, `iphone-15-plus`, `iphone-15-pro`, |
| 205 | + |
| 206 | +```yaml |
| 207 | +--- |
| 208 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 209 | + uses: dcd-com/action-trigger-test-run@v1 |
| 210 | + with: |
| 211 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 212 | + ios-device: iphone-14 |
| 213 | +``` |
| 214 | + |
| 215 | +### `ios-version` |
| 216 | + |
| 217 | +**Optional** - [iOS only] iOS version to run your flow against. Options: `15`, `16`, `17`. |
| 218 | + |
| 219 | +```yaml |
| 220 | +--- |
| 221 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 222 | + uses: dcd-com/action-trigger-test-run@v1 |
| 223 | + with: |
| 224 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 225 | + ios-version: 16 |
| 226 | +``` |
| 227 | + |
| 228 | +### `name` |
| 229 | + |
| 230 | +**Optional** - A custom name for your upload (useful for tagging commits etc). |
| 231 | + |
| 232 | +```yaml |
| 233 | +--- |
| 234 | +- name: devicecloud.dev - Trigger Mobile App Test Run |
| 235 | + uses: dcd-com/action-trigger-test-run@v1 |
| 236 | + with: |
| 237 | + api-key: ${{ secrets.DCD_API_KEY }} |
| 238 | + name: 'My Custom Upload Name' |
| 239 | +``` |
0 commit comments