diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6dee25b..5fb30b7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -39,6 +39,8 @@ jobs: name: "android_3_0" output: "output" version: "1.0.38" + resultFile: "some-result.json" + branch: "develop" - name: Check if output folder exists and is not empty run: | @@ -49,12 +51,26 @@ jobs: exit 1 fi + - name: Check if resultFile exists + run: | + if [ ! -f "some-result.json" ]; then + echo "Error: some-result.json does not exist." + exit 1 + fi + - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: output_android path: output + - name: Upload resultFile + if: always() + uses: actions/upload-artifact@v4 + with: + name: some-result.json + path: some-result.json + check_failed_android: runs-on: ubuntu-latest @@ -84,9 +100,9 @@ jobs: fi - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: output_android + name: output_android_failed path: output check_ios: @@ -117,7 +133,7 @@ jobs: fi - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: output_ios path: output diff --git a/README.md b/README.md index b1eed55..0389242 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,14 @@ jobs: - name: Build app run: ./gradlew assembleDebug assembleAndroidTest - name: Run tests - uses: MarathonLabs/action-test@1.0.11 + uses: MarathonLabs/action-test@1.0.13 with: apiKey: ${{ secrets.MARATHON_CLOUD_API_TOKEN }} application: app/build/outputs/apk/debug/app-debug.apk testApplication: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk platform: android output: "./results" - version: "1.0.30" + version: "1.0.38" ``` ## Inputs @@ -57,6 +57,8 @@ jobs: | `xctestrunTestEnv` (optional) | Xctestrun testing environment variables, format: 'VAR1=VALUE1,VAR2=VALUE2' | `` | `VAR1=VALUE1,VAR2=VALUE2` | | `ignoreTestFailures` (optional) | When tests fail and this option is true then GHA will exit with code 0. By default, GHA will exit with code 1 in case of test failures and 0 for passing tests [possible values: true, false] | `false` | `true`, `false` | | `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` | ## marathon-cloud version diff --git a/action.yaml b/action.yaml index e2dc4ed..fe8b732 100644 --- a/action.yaml +++ b/action.yaml @@ -70,6 +70,12 @@ inputs: pullFiles: description: "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. Example: EXTERNAL_STORAGE:Documents/some-results,APP_DATA:files/my_folder/some_file.txt. Note: Files with the same name and path from different devices may overwrite each other." required: false + resultFile: + description: "Result file path in a machine-readable format. You can specify the format via extension [yaml,json]. Default file: result.json" + required: false + branch: + description: "Branch for run, for example it could be git branch like develop or feature/about-screen" + required: false branding: color: purple icon: play-circle @@ -81,7 +87,7 @@ runs: with: version: ${{ inputs.version }} - name: Run tests using marathon-cloud - uses: MarathonLabs/action-invoke@1.0.9 + uses: MarathonLabs/action-invoke@1.0.10 with: apiKey: ${{ inputs.apiKey }} application: ${{ inputs.application }} @@ -105,3 +111,5 @@ runs: xctestrunTestEnv: ${{ inputs.xctestrunTestEnv }} ignoreTestFailures: ${{ inputs.ignoreTestFailures }} pullFiles: ${{ inputs.pullFiles }} + resultFile: ${{ inputs.resultFile }} + branch: ${{ inputs.branch }}