Skip to content

Commit

Permalink
Version 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
axelniklasson committed Aug 31, 2023
1 parent d701602 commit baa70d5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 17 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Run your Flows on [Maestro Cloud](https://cloud.mobile.dev).
Add the following to your workflow. Note that you can use the `v1` tag if you want to keep using the latest version of the action, which will automatically resolve to all `v1.minor.patch` versions as they get published.

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: <path_to_your_app_file>
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
# Android

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app/build/outputs/apk/debug/app-debug.apk
Expand All @@ -58,7 +58,7 @@ jobs:
Include the Proguard mapping file to deobfuscate Android performance traces:

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app/build/outputs/apk/release/app-release.apk
Expand All @@ -68,7 +68,7 @@ Include the Proguard mapping file to deobfuscate Android performance traces:
# iOS

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: <app_name>.app
Expand All @@ -80,7 +80,7 @@ Include the Proguard mapping file to deobfuscate Android performance traces:
### .dSYM file

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: <app_name>.app
Expand All @@ -94,7 +94,7 @@ Include the Proguard mapping file to deobfuscate Android performance traces:
By default, the action is looking for a `.maestro` folder with Maestro flows in the root directory of the project. If you would like to customize this behaviour, you can override it with a `workspace` argument:

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.zip
Expand All @@ -112,7 +112,7 @@ A name will automatically be provided according to the following order:
If you want to override this behaviour and specify your own name, you can do so by setting the `name` argument:

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.zip
Expand All @@ -124,7 +124,7 @@ If you want to override this behaviour and specify your own name, you can do so
If you don't want the action to wait until the Upload has been completed as is the default behaviour, set the `async` argument to `true`:

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.zip
Expand All @@ -136,7 +136,7 @@ If you don't want the action to wait until the Upload has been completed as is t
If you want to pass environment variables along with your upload, add a multiline `env` argument:

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.zip
Expand All @@ -152,7 +152,7 @@ You can use Maestro (Tags)[https://maestro.mobile.dev/cli/tags] to filter which
You can either pass a single value, or comma-separated (`,`) values.

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.zip
Expand All @@ -167,7 +167,7 @@ You can specify what Android API level to use when running in Maestro Cloud usin
The default API level is 30.

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.apk
Expand All @@ -181,7 +181,7 @@ You can specify what **major** iOS Version to use when running in Maestro Cloud
The default iOS version is 15.

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: app.zip
Expand All @@ -199,7 +199,7 @@ The following output variables are set by the action:
In order to access these variables you can use the following approach:

```yaml
- uses: mobile-dev-inc/action-maestro-cloud@v1.4.1
- uses: mobile-dev-inc/action-maestro-cloud@v1.5.0
with:
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }}
app-file: <your_app_file>
Expand Down
35 changes: 31 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46538,7 +46538,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.UploadStatusError = exports.BenchmarkStatus = void 0;
exports.CancellationReason = exports.UploadStatusError = exports.BenchmarkStatus = void 0;
const node_fetch_1 = __importStar(__nccwpck_require__(4429));
var BenchmarkStatus;
(function (BenchmarkStatus) {
Expand All @@ -46556,6 +46556,13 @@ class UploadStatusError {
}
}
exports.UploadStatusError = UploadStatusError;
var CancellationReason;
(function (CancellationReason) {
CancellationReason["BENCHMARK_DEPENDENCY_FAILED"] = "BENCHMARK_DEPENDENCY_FAILED";
CancellationReason["INFRA_ERROR"] = "INFRA_ERROR";
CancellationReason["OVERLAPPING_BENCHMARK"] = "OVERLAPPING_BENCHMARK";
CancellationReason["TIMEOUT"] = "TIMEOUT";
})(CancellationReason = exports.CancellationReason || (exports.CancellationReason = {}));
class ApiClient {
constructor(apiKey, apiUrl) {
this.apiKey = apiKey;
Expand Down Expand Up @@ -46588,7 +46595,7 @@ class ApiClient {
}
getUploadStatus(uploadId) {
return __awaiter(this, void 0, void 0, function* () {
const res = yield (0, node_fetch_1.default)(`${this.apiUrl}/v2/upload/${uploadId}/status`, {
const res = yield (0, node_fetch_1.default)(`${this.apiUrl}/v2/upload/${uploadId}/status?includeErrors=true`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${this.apiKey}`,
Expand Down Expand Up @@ -46656,18 +46663,35 @@ const WAIT_TIMEOUT_MS = 1000 * 60 * 30; // 30 minutes
const INTERVAL_MS = 10000; // 10 seconds
const TERMINAL_STATUSES = new Set([ApiClient_1.BenchmarkStatus.SUCCESS, ApiClient_1.BenchmarkStatus.ERROR, ApiClient_1.BenchmarkStatus.WARNING, ApiClient_1.BenchmarkStatus.CANCELED]);
const isCompleted = (flow) => TERMINAL_STATUSES.has(flow.status);
const getCanceledStatusMessage = (reason) => {
switch (reason) {
case ApiClient_1.CancellationReason.BENCHMARK_DEPENDENCY_FAILED:
case ApiClient_1.CancellationReason.OVERLAPPING_BENCHMARK:
return 'Skipped';
case ApiClient_1.CancellationReason.TIMEOUT:
return 'Timeout';
case ApiClient_1.CancellationReason.INFRA_ERROR:
default:
return 'Canceled';
}
};
const renderError = (errors) => {
if (!errors || errors.length === 0)
return '';
return ` (${errors[0]})`;
};
const printFlowResult = (flow) => {
if (flow.status === ApiClient_1.BenchmarkStatus.SUCCESS) {
(0, log_1.success)(`[Passed] ${flow.name}`);
}
else if (flow.status === ApiClient_1.BenchmarkStatus.ERROR) {
(0, log_1.err)(`[Failed] ${flow.name}`);
(0, log_1.err)(`[Failed] ${flow.name}${renderError(flow.errors)}`);
}
else if (flow.status === ApiClient_1.BenchmarkStatus.WARNING) {
(0, log_1.warning)(`[Warning] ${flow.name}`);
}
else if (flow.status === ApiClient_1.BenchmarkStatus.CANCELED) {
(0, log_1.canceled)(`[Canceled] ${flow.name}`);
(0, log_1.canceled)(`[${getCanceledStatusMessage(flow.cancellationReason)}] ${flow.name}`);
}
};
const flowWord = (count) => count === 1 ? 'Flow' : 'Flows';
Expand Down Expand Up @@ -46727,6 +46751,8 @@ class StatusPoller {
console.log('');
(0, log_1.info)(`==== View details in the console ====\n`);
(0, log_1.info)(`${this.consoleUrl}`);
core.setOutput('MAESTRO_CLOUD_UPLOAD_STATUS', status);
core.setOutput('MAESTRO_CLOUD_FLOW_RESULTS', flows);
if (status === ApiClient_1.BenchmarkStatus.ERROR) {
const resultStr = getFailedFlowsCountStr(flows);
console.log('');
Expand Down Expand Up @@ -47043,6 +47069,7 @@ const run = () => __awaiter(void 0, void 0, void 0, function* () {
const { uploadId, teamId, targetId: appId } = yield client.uploadRequest(request, appFile.path, workspaceZip, mappingFile && (yield (0, archive_utils_1.zipIfFolder)(mappingFile)));
const consoleUrl = (0, exports.getConsoleUrl)(uploadId, teamId, appId);
(0, log_1.info)(`Visit the web console for more details about the upload: ${consoleUrl}\n`);
core.setOutput('MAESTRO_CLOUD_CONSOLE_URL', consoleUrl);
!async && new StatusPoller_1.default(client, uploadId, consoleUrl).startPolling();
});
run().catch(e => {
Expand Down

0 comments on commit baa70d5

Please sign in to comment.