Skip to content

Commit ab69a6f

Browse files
committed
init
0 parents  commit ab69a6f

File tree

12 files changed

+954
-0
lines changed

12 files changed

+954
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build Source
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- 'src/**'
10+
- 'package.json'
11+
- 'yarn.lock'
12+
- 'tsconfig.json'
13+
14+
jobs:
15+
build:
16+
name: Build
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
steps:
21+
- name: Checkout Repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20.x'
30+
31+
- name: Install Dependencies
32+
run: yarn install
33+
34+
- name: Compile files
35+
run: yarn build
36+
37+
- name: Setup Git Credentials
38+
run: |
39+
git config user.name github-actions
40+
git config user.email github-actions@github.com
41+
42+
- name: Commit Files
43+
continue-on-error: true # commit will fail if the code wasn't changed. Prevent the build to fail in this case.
44+
run: |
45+
git add dist/index.js -f
46+
git commit -m "[CI] Add changes"
47+
48+
- name: Push changes
49+
uses: ad-m/github-push-action@v0.8.0
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
branch: master
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update major release tag
2+
run-name: Update major release tag for ${{ github.ref }}
3+
4+
on:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
movetag:
10+
permissions: write-all
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Git Credentials
19+
run: |
20+
git config user.name github-actions
21+
git config user.email github-actions@github.com
22+
23+
- name: Update tag to major version
24+
run: |
25+
VERSION=${{ github.ref_name }}
26+
MAJOR=${VERSION%%.*}
27+
28+
echo "Updating tag ${MAJOR} (source: ${VERSION}) to ${GITHUB_SHA}"
29+
30+
git tag -f ${MAJOR}
31+
git push origin ${MAJOR} --force

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.DS_Store
2+
node_modules/
3+
yarn-error.log

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"bracketSameLine": true,
4+
"endOfLine": "auto"
5+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) DCD LIMITED
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

README.md

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
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

Comments
 (0)