Skip to content

Commit 2329faa

Browse files
Merge pull request #8 from Genymobile/features/support-api-token
[Feature] Support api token
2 parents 28dbbcb + 69e4f00 commit 2329faa

File tree

9 files changed

+97
-88
lines changed

9 files changed

+97
-88
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ jobs:
44
lint:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v1
8-
- uses: actions/setup-node@v1
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-node@v4
99
with:
10-
node-version: '12.x'
10+
node-version: '20'
1111
- run: npm install
1212
- run: npm run lint
1313

@@ -21,26 +21,25 @@ jobs:
2121
name: With Adb Serial Port
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

26-
- uses: actions/setup-python@v4
26+
- uses: actions/setup-python@v5
2727
with:
28-
python-version: "3.10.11"
28+
python-version: "3.12.0"
2929

3030
- name: Set up JDK 17
31-
uses: actions/setup-java@v3
31+
uses: actions/setup-java@v4
3232
with:
3333
java-version: "17"
3434
distribution: "temurin"
3535

3636
- name: Setup Android SDK
37-
uses: android-actions/setup-android@v2
37+
uses: android-actions/setup-android@v3
3838

3939
- name: Start Genymotion Cloud SaaS instance
4040
uses: ./
4141
with:
42-
email: ${{ secrets.GMSAAS_EMAIL }}
43-
password: ${{ secrets.GMSAAS_PASSWORD }}
42+
api_token: ${{ secrets.GMSAAS_APITOKEN }}
4443
recipe_uuid: ${{ matrix.recipe_uuid }}
4544
adb_serial_port: "47021"
4645

@@ -55,27 +54,26 @@ jobs:
5554
name: Start Several devices
5655
steps:
5756
- name: Checkout
58-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
5958

60-
- uses: actions/setup-python@v4
59+
- uses: actions/setup-python@v5
6160
with:
62-
python-version: "3.10.11"
61+
python-version: "3.12.0"
6362

6463
- name: Set up JDK 17
65-
uses: actions/setup-java@v3
64+
uses: actions/setup-java@v4
6665
with:
6766
java-version: "17"
6867
distribution: "temurin"
6968

7069
- name: Setup Android SDK
71-
uses: android-actions/setup-android@v2
70+
uses: android-actions/setup-android@v3
7271

7372
- name: Genymotion
7473
uses: ./
7574
with:
76-
email: ${{ secrets.GMSAAS_EMAIL }}
77-
password: ${{ secrets.GMSAAS_PASSWORD }}
7875
recipe_uuid: ${{ matrix.recipe_uuid }}
76+
api_token: ${{ secrets.GMSAAS_APITOKEN }}
7977

8078
test-integration-specific_gmsaas_version:
8179
runs-on: ubuntu-latest
@@ -87,28 +85,26 @@ jobs:
8785
name: Use a specific gmsaas version
8886
steps:
8987
- name: Checkout
90-
uses: actions/checkout@v3
88+
uses: actions/checkout@v4
9189

92-
- uses: actions/setup-python@v4
90+
- uses: actions/setup-python@v5
9391
with:
94-
python-version: "3.10.11"
92+
python-version: "3.12.0"
9593

9694
- name: Set up JDK 17
97-
uses: actions/setup-java@v3
95+
uses: actions/setup-java@v4
9896
with:
9997
java-version: "17"
10098
distribution: "temurin"
10199

102100
- name: Setup Android SDK
103-
uses: android-actions/setup-android@v2
101+
uses: android-actions/setup-android@v3
104102

105103
- name: Genymotion
106104
uses: ./
107105
with:
108-
gmsaas_version: "1.6.0"
109-
email: ${{ secrets.GMSAAS_EMAIL }}
110-
password: ${{ secrets.GMSAAS_PASSWORD }}
111-
recipe_uuid: ${{ matrix.recipe_uuid }}
106+
gmsaas_version: "1.12.0"
107+
api_token: ${{ secrets.GMSAAS_APITOKEN }}
112108

113109

114110
test-integration-install_configure_gmsaas:
@@ -117,23 +113,22 @@ jobs:
117113
name: Only install and configure gmsaas
118114
steps:
119115
- name: Checkout
120-
uses: actions/checkout@v3
116+
uses: actions/checkout@v4
121117

122-
- uses: actions/setup-python@v4
118+
- uses: actions/setup-python@v5
123119
with:
124-
python-version: "3.10.11"
120+
python-version: "3.12.0"
125121

126122
- name: Set up JDK 17
127-
uses: actions/setup-java@v3
123+
uses: actions/setup-java@v4
128124
with:
129125
java-version: "17"
130126
distribution: "temurin"
131127

132128
- name: Setup Android SDK
133-
uses: android-actions/setup-android@v2
129+
uses: android-actions/setup-android@v3
134130

135131
- name: Genymotion
136132
uses: ./
137133
with:
138-
email: ${{ secrets.GMSAAS_EMAIL }}
139-
password: ${{ secrets.GMSAAS_PASSWORD }}
134+
api_token: ${{ secrets.GMSAAS_APITOKEN }}

README.md

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ that credentials keys should be stored as [GitHub secrets](https://docs.github.c
88

99
## Inputs
1010

11-
- `email` {string} {required} Email of your Genymotion Cloud SaaS account, if you don't have an account please create it first at [https://cloud.geny.io](https://cloud.geny.io/?&utm_source=web-referral&utm_medium=docs&utm_campaign=githubactions&utm_content=signup). `GMSAAS_EMAIL` should be stored as a [GitHub secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization) and passed as in the
12-
example below. **Never** store your `GMSAAS_EMAIL` as plain text in your YAML workflow.
13-
- `password` {string} {required} The password of your Genymotion Cloud SaaS account. `GMSAAS_PASSWORD` should be stored as a [GitHub secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization) and passed as in the
14-
example below. **Never** store your `GMSAAS_PASSWORD` as plain text in your YAML workflow.
11+
- `api_token` {string} {required} API Token to authenticate to your Genymotion Cloud SaaS account. If you don't have an account please register on [https://cloud.geny.io](https://cloud.geny.io/?&utm_source=web-referral&utm_medium=docs&utm_campaign=githubactions&utm_content=signup) and create an [API Token](https://cloud.geny.io/api). `GMSAAS_APITOKEN` should be stored as a [GitHub secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization) and passed as in the
12+
example below. **Never** store your `GMSAAS_APITOKEN` as plain text in your YAML workflow.
1513
- `gmsaas_version` {string} {optional} Install a specific version of gmsaas (not recommended). Defaults to the latest version if not specified.
1614
- `recipe_uuid` {string} {optional} Recipe UUID is the identifier used when starting an instance; it can be retrieved using `gmsaas recipes list`,
1715
or check [availables recipes](https://support.genymotion.com/hc/en-us/articles/360007473658-Supported-Android-devices-templates-for-Genymotion-Cloud-SaaS) for a comprehensive list of all currently available recipes.
@@ -38,26 +36,25 @@ jobs:
3836
runs-on: ubuntu-latest
3937
steps:
4038
- name: Checkout
41-
uses: actions/checkout@v3
39+
uses: actions/checkout@v4
4240
43-
- uses: actions/setup-python@v4
41+
- uses: actions/setup-python@v5
4442
with:
45-
python-version: "3.10.11"
43+
python-version: "3.12.0"
4644
4745
- name: Set up JDK 17
48-
uses: actions/setup-java@v3
46+
uses: actions/setup-java@v4
4947
with:
5048
java-version: "17"
5149
distribution: "temurin"
5250
5351
- name: Setup Android SDK
54-
uses: android-actions/setup-android@v2
52+
uses: android-actions/setup-android@v3
5553
5654
- name: Start Genymotion Cloud SaaS instance
57-
uses: genymobile/genymotion-saas-github-action@v0.4
55+
uses: genymobile/genymotion-saas-github-action@v1
5856
with:
59-
email: ${{ secrets.GMSAAS_EMAIL }}
60-
password: ${{ secrets.GMSAAS_PASSWORD }}
57+
api_token: ${{ secrets.GMSAAS_APITOKEN }}
6158
recipe_uuid: ea5fda48-fa8b-48c1-8acc-07d910856141 # Google Pixel XL 8.1
6259
```
6360

@@ -79,26 +76,25 @@ jobs:
7976
- 4c015ada-e64e-4f5d-a320-06cbf6e95648 # android 10
8077
steps:
8178
- name: Checkout
82-
uses: actions/checkout@v3
79+
uses: actions/checkout@v4
8380
84-
- uses: actions/setup-python@v4
81+
- uses: actions/setup-python@v5
8582
with:
8683
python-version: "3.10.11"
8784
8885
- name: Set up JDK 17
89-
uses: actions/setup-java@v3
86+
uses: actions/setup-java@v4
9087
with:
9188
java-version: "17"
9289
distribution: "temurin"
9390
9491
- name: Setup Android SDK
95-
uses: android-actions/setup-android@v2
92+
uses: android-actions/setup-android@v3
9693
9794
- name: Start Genymotion Cloud SaaS instance
98-
uses: genymobile/genymotion-saas-github-action@v0.4
95+
uses: genymobile/genymotion-saas-github-action@v1
9996
with:
100-
email: ${{ secrets.GMSAAS_EMAIL }}
101-
password: ${{ secrets.GMSAAS_PASSWORD }}
97+
api_token: ${{ secrets.GMSAAS_APITOKEN }}
10298
recipe_uuid: ${{ matrix.recipe_uuid }}
10399
```
104100

@@ -115,26 +111,25 @@ jobs:
115111
runs-on: ubuntu-latest
116112
steps:
117113
- name: Checkout
118-
uses: actions/checkout@v3
114+
uses: actions/checkout@v4
119115
120-
- uses: actions/setup-python@v4
116+
- uses: actions/setup-python@v5
121117
with:
122-
python-version: "3.10.11"
118+
python-version: "3.12.0"
123119
124120
- name: Set up JDK 17
125-
uses: actions/setup-java@v3
121+
uses: actions/setup-java@v4
126122
with:
127123
java-version: "17"
128124
distribution: "temurin"
129125
130126
- name: Setup Android SDK
131-
uses: android-actions/setup-android@v2
127+
uses: android-actions/setup-android@v3
132128
133129
- name: Start Genymotion Cloud SaaS instance
134-
uses: genymobile/genymotion-saas-github-action@v0.4
130+
uses: genymobile/genymotion-saas-github-action@v1
135131
with:
136-
email: ${{ secrets.GMSAAS_EMAIL }}
137-
password: ${{ secrets.GMSAAS_PASSWORD }}
132+
api_token: ${{ secrets.GMSAAS_APITOKEN }}
138133
recipe_uuid: ea5fda48-fa8b-48c1-8acc-07d910856141 # Google Pixel XL 8.1
139134
adb_serial_port: "47021"
140135
```

action.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ description: |-
44
Launch Android devices on Genymotion SaaS.
55
Run your automation tests (Appium, Espresso and others) on those devices.
66
inputs:
7-
email:
8-
description: Email of your Genymotion Cloud SaaS account, if you don't have an account please create it first on [https://cloud.geny.io](https://cloud.geny.io/?&utm_source=web-referral&utm_medium=docs&utm_campaign=githubactions&utm_content=signup).
9-
required: true
10-
password:
11-
description: Password of your Genymotion Cloud SaaS account.
7+
api_token:
8+
description: API Token to authenticate to your Genymotion Cloud SaaS account. If you don't have an account please register on [https://cloud.geny.io](https://cloud.geny.io/?&utm_source=web-referral&utm_medium=docs&utm_campaign=githubactions&utm_content=signup) and create an [API Token](https://cloud.geny.io/api)
129
required: true
1310
recipe_uuid:
1411
description: |-
@@ -35,7 +32,7 @@ outputs:
3532
This output will include the instance UUID of started and connected instance.
3633
3734
runs:
38-
using: 'node12'
35+
using: 'node20'
3936
main: 'dist/setup/index.js'
4037
post: 'dist/cleanup/index.js'
4138

dist/cleanup/index.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/cleanup/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup/index.js

Lines changed: 14 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cleanup/post.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ async function run() {
1212
core.setFailed(error.message);
1313
}
1414
}
15+
16+
try {
17+
core.info('Reset Genymotion SaaS authentication');
18+
await exec.exec('gmsaas auth reset');
19+
} catch (error) {
20+
core.setFailed(error.message);
21+
}
1522
}
1623

1724
run();

0 commit comments

Comments
 (0)