Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Malinskiy committed Jun 8, 2023
0 parents commit c5eba15
Show file tree
Hide file tree
Showing 10 changed files with 9,716 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Marathon Labs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# MarathonLabs/action-invoke

This action wraps [marathon-cloud][] CLI in your GitHub Actions workflow.

## Action Inputs

| Name | Description | Default | Example |
| :--------------------------: | ------------------------------------------------------- | ------- | ------------------------------------------------ |
| `apiKey` (required) | Marathon Cloud API key | `` | `cafebabe` |
| `application` (required) | Application binary path, e.g. apk file for Android | `` | `app/build/output/apk/app-debug.apk` |
| `testApplication` (required) | Test application binary path, e.g. apk file for Android | `` | `app/build/output/apk/app-androidTest-debug.apk` |
| `output` (optional) | Output folder path | `` | `` |
| `link` (optional) | Link to commit | `` | `` |

## Usage Examples

### Basic

```yaml
- name: run tests using marathon-cloud
uses: MarathonLabs/[email protected]
with:
apiKey: "cafebabe"
application: "app/build/output/apk/app-debug.apk"
testApplication: "app/build/output/apk/app-androidTest-debug.apk"
```
### Developing
The action source is located at [/src](/src). The action is written in TypeScript and compiled to a single javascript file with [`ncc`][ncc]. It's expected to checkin `lib/index.js` to the repository.

To setup the development environment, run the following commands:

```bash
$ npm install
```

To build the action script, run the following command:

```bash
$ npm run build
```

To test the action, we can use the workflow [Test workflow](https://github.com/MarathonLabs/setup-marathon-cloud/actions/workflows/test-marathon-cloud.yaml) to trigger a build.

[ncc]: https://github.com/vercel/ncc
[marathon-cloud]: https://github.com/MarathonLabs/marathon-cloud-cli

## LICENSE

MIT
25 changes: 25 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Invoke marathon-cloud cli
description: Invoke marathon-cloud CLI in GitHub Actions
inputs:
apiKey:
description: "API key for authenticating with Marathon Cloud"
required: true
application:
description: "Application binary path, e.g. apk file for Android"
required: true
testApplication:
description: "Test application binary path, e.g. apk file for Android"
required: true
link:
description: "Link to commit"
required: false
output:
description: "Output folder"
required: false
default: "marathon"
branding:
icon: "play"
color: "purple"
runs:
using: "node16"
main: "lib/index.js"
6 changes: 6 additions & 0 deletions hack/ensure-generated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -euo pipefail

npm run build 2>&1 >/dev/null
git status --porcelain=v1 2>/dev/null | grep -q '^.M lib/index.js' && (echo "Generated files are out of date. Please run 'npm run build' and commit the changes." && exit 1) || exit 0
5 changes: 5 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
Loading

0 comments on commit c5eba15

Please sign in to comment.