Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
265 changes: 133 additions & 132 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@ on:
pull_request:

jobs:
check_simple_android:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "16"

- name: Setup Marathon Cloud
uses: MarathonLabs/[email protected]
with:
version: "1.0.38"

- name: Run Marathon Cloud action-invoke
uses: ./
with:
apiKey: ${{ secrets.RUN_TOKEN }}
application: "example/app.apk"
testApplication: "example/appTest.apk"
platform: "android"
name: "android_3_0_simple"

- name: Show failure message
if: failure()
run: |
echo "❌ Marathon Cloud action-invoke failed. Please check the following:"
echo "1. Ensure that you have updated lib/index.js. See README for updating details."
exit 1
# check_simple_android:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: "16"

# - name: Setup Marathon Cloud
# uses: MarathonLabs/[email protected]
# with:
# version: "1.0.38"

# - name: Run Marathon Cloud action-invoke
# uses: ./
# with:
# apiKey: ${{ secrets.RUN_TOKEN }}
# application: "example/app.apk"
# testApplication: "example/appTest.apk"
# platform: "android"
# name: "android_3_0_simple"

# - name: Show failure message
# if: failure()
# run: |
# echo "❌ Marathon Cloud action-invoke failed. Please check the following:"
# echo "1. Ensure that you have updated lib/index.js. See README for updating details."
# exit 1

check_output_android:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -66,6 +66,7 @@ jobs:
output: "output"
resultFile: "some-result.json"
branch: "develop"
project: "temp_project"

- name: Check if output folder exists and is not empty
run: |
Expand Down Expand Up @@ -104,103 +105,103 @@ jobs:
echo "1. Ensure that you have updated lib/index.js. See README for updating details."
exit 1

check_output_failed_android:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "16"

- name: Setup Marathon Cloud
uses: MarathonLabs/[email protected]
with:
version: "1.0.38"

- name: Run Marathon Cloud action-invoke
uses: ./
with:
apiKey: ${{ secrets.RUN_TOKEN }}
application: "example/app.apk"
testApplication: "example/appTestFailed.apk"
platform: "android"
name: "android_3_0_failed"
output: "output"
ignoreTestFailures: "true"

- name: Check if output folder exists and is not empty
run: |
if [ -d "output" ] && [ "$(ls -A output)" ]; then
echo "Output folder exists and is not empty."
else
echo "Output folder does not exist or is empty."
exit 1
fi

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: android_failed_output
path: output

- name: Show failure message
if: failure()
run: |
echo "❌ Marathon Cloud action-invoke failed. Please check the following:"
echo "1. Ensure that you have updated lib/index.js. See README for updating details."
exit 1

check_ios:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "16"

- name: Setup Marathon Cloud
uses: MarathonLabs/[email protected]
with:
version: "1.0.38"

- name: Run Marathon Cloud action-invoke
uses: ./
with:
apiKey: ${{ secrets.RUN_TOKEN }}
application: "example/sample.zip"
testApplication: "example/sampleUITests-Runner.zip"
platform: "ios"
name: "ios_3_0"
output: "output"

- name: Check if output folder exists and is not empty
run: |
if [ -d "output" ] && [ "$(ls -A output)" ]; then
echo "Output folder exists and is not empty."
else
echo "Output folder does not exist or is empty."
exit 1
fi

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ios_output
path: output

- name: Show failure message
if: failure()
run: |
echo "❌ Marathon Cloud action-invoke failed. Please check the following:"
echo "1. Ensure that you have updated lib/index.js. See README for updating details."
exit 1
# check_output_failed_android:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: "16"

# - name: Setup Marathon Cloud
# uses: MarathonLabs/[email protected]
# with:
# version: "1.0.38"

# - name: Run Marathon Cloud action-invoke
# uses: ./
# with:
# apiKey: ${{ secrets.RUN_TOKEN }}
# application: "example/app.apk"
# testApplication: "example/appTestFailed.apk"
# platform: "android"
# name: "android_3_0_failed"
# output: "output"
# ignoreTestFailures: "true"

# - name: Check if output folder exists and is not empty
# run: |
# if [ -d "output" ] && [ "$(ls -A output)" ]; then
# echo "Output folder exists and is not empty."
# else
# echo "Output folder does not exist or is empty."
# exit 1
# fi

# - name: Upload artifact
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: android_failed_output
# path: output

# - name: Show failure message
# if: failure()
# run: |
# echo "❌ Marathon Cloud action-invoke failed. Please check the following:"
# echo "1. Ensure that you have updated lib/index.js. See README for updating details."
# exit 1

# check_ios:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout repository
# uses: actions/checkout@v2

# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: "16"

# - name: Setup Marathon Cloud
# uses: MarathonLabs/[email protected]
# with:
# version: "1.0.38"

# - name: Run Marathon Cloud action-invoke
# uses: ./
# with:
# apiKey: ${{ secrets.RUN_TOKEN }}
# application: "example/sample.zip"
# testApplication: "example/sampleUITests-Runner.zip"
# platform: "ios"
# name: "ios_3_0"
# output: "output"

# - name: Check if output folder exists and is not empty
# run: |
# if [ -d "output" ] && [ "$(ls -A output)" ]; then
# echo "Output folder exists and is not empty."
# else
# echo "Output folder does not exist or is empty."
# exit 1
# fi

# - name: Upload artifact
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: ios_output
# path: output

# - name: Show failure message
# if: failure()
# run: |
# echo "❌ Marathon Cloud action-invoke failed. Please check the following:"
# echo "1. Ensure that you have updated lib/index.js. See README for updating details."
# exit 1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This action wraps [marathon-cloud][] CLI in your GitHub Actions workflow.
| `pullFiles` (optional) | Pull files from devices after the test run. The format is `ROOT1:PATH1,ROOT2:PATH2` where ROOT is one of [EXTERNAL_STORAGE, APP_DATA] and PATH is a relative path to the target file or directory. Note: Files with the same name and path from different devices may overwrite each other. | `` | `EXTERNAL_STORAGE:Documents/some-results,APP_DATA:files/my_folder/some_file.txt` |
| `resultFile` (optional) | Result file path in a machine-readable format. You can specify the format via extension [yaml,json] | `result.json` | `some_result.json` |
| `branch` (optional) | Branch for run, for example it could be git branch like develop or feature/about-screen | `` | `develop` |
| `project` (optional) | The unique identifier (slug) for the project | `` | `` |

## Usage Examples

Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ inputs:
branch:
description: "Branch for run, for example it could be git branch like develop or feature/about-screen"
required: false
project:
description: "The unique identifier (slug) for the project"
required: false
branding:
icon: "play"
color: "purple"
Expand Down
15 changes: 11 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3986,7 +3986,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.buildDownloadArgs = exports.buildiOSArgs = exports.buildAndroidArgs = void 0;
const core = __importStar(__nccwpck_require__(186));
function buildAndroidArgs(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, ignoreTestFailures, resultFile, pullFiles, branch) {
function buildAndroidArgs(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, ignoreTestFailures, resultFile, pullFiles, branch, project) {
const args = [
"run",
"android",
Expand Down Expand Up @@ -4052,10 +4052,13 @@ function buildAndroidArgs(apiKey, application, testApplication, link, osVersion,
if (branch) {
args.push("--branch", branch);
}
if (project) {
args.push("--project", project);
}
return args;
}
exports.buildAndroidArgs = buildAndroidArgs;
function buildiOSArgs(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, ignoreTestFailures, resultFile, pullFiles, branch) {
function buildiOSArgs(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, ignoreTestFailures, resultFile, pullFiles, branch, project) {
const args = [
"run",
"ios",
Expand Down Expand Up @@ -4123,6 +4126,9 @@ function buildiOSArgs(apiKey, application, testApplication, link, osVersion, sys
if (branch) {
args.push("--branch", branch);
}
if (project) {
args.push("--project", project);
}
return args;
}
exports.buildiOSArgs = buildiOSArgs;
Expand Down Expand Up @@ -4216,15 +4222,16 @@ function main() {
const resultFile = core.getInput("resultFile") || "result.json";
const pullFiles = core.getInput("pullFiles");
const branch = core.getInput("branch");
const project = core.getInput("project");
let args = [];
const lowercasePlatform = platform.toLowerCase();
switch (lowercasePlatform) {
case "android": {
args = (0, command_1.buildAndroidArgs)(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, "", resultFile, pullFiles, branch);
args = (0, command_1.buildAndroidArgs)(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, "", resultFile, pullFiles, branch, project);
break;
}
case "ios": {
args = (0, command_1.buildiOSArgs)(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, "", resultFile, pullFiles, branch);
args = (0, command_1.buildiOSArgs)(apiKey, application, testApplication, link, osVersion, systemImage, isolated, flavor, filterFile, wait, name, device, xcodeVersion, xctestplanFilterFile, xctestplanTargetName, xctestrunEnv, xctestrunTestEnv, "", resultFile, pullFiles, branch, project);
break;
}
default: {
Expand Down
10 changes: 10 additions & 0 deletions src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function buildAndroidArgs(
resultFile: string,
pullFiles: string,
branch: string,
project: string,
): string[] {
const args = [
"run",
Expand Down Expand Up @@ -106,6 +107,10 @@ export function buildAndroidArgs(
args.push("--branch", branch);
}

if (project) {
args.push("--project", project);
}

return args;
}

Expand All @@ -131,6 +136,7 @@ export function buildiOSArgs(
resultFile: string,
pullFiles: string,
branch: string,
project: string,
): string[] {
const args = [
"run",
Expand Down Expand Up @@ -221,6 +227,10 @@ export function buildiOSArgs(
args.push("--branch", branch);
}

if (project) {
args.push("--project", project);
}

return args;
}

Expand Down
Loading
Loading