Skip to main content

YAML Syntax

When defining routines in YAML, use the following syntax:

name

required

Defines the name of the routine.

Example

name: sample-routine

on

required

Type: { workflow_dispatch: empty string }

caution

Currently, no separate values ​​are entered.

on:
workflow_dispatch:

Define when the routine runs.


Properties

  • workflow_dispatch

예시

on:
workflow_dispatch:

env

optional
environment variable precedence

The env property defines environment variables to be used throughout the routine. The env property inside the step property defines environment variables to be used in the step. If an environment variable with the same env key name is defined both throughout the routine and in step, the environment variable defined in step takes precedence.


Defines environment variables to be used by routines. It can be defined in the form of key-value pairs.

Example

env:
key1: value1
key2: value2

Define environment variables named key1 and key2. The respective values ​​are value1 and value2.

jobs

required

A list of Jobs to be executed in the routine. Jobs run in parallel by default.

Example

jobs:
job1:
runs-on:
group: host
steps:
- name: step1
run: echo step1...

Define a Job named job1.
job1 runs on the device tagged with "host", and job1 runs a step named step1.

jobs.<job-name>.runs-on

required

Defines the environment in which the Job will be executed. It can be specified as a device tag name or a specific device name.

Designate as a specific device name or tag

  1. Run single devices

    jobs:
    job1:
    runs-on: your-device-name
    steps:
    - name: step1
    run: echo step1...
  2. Run multiple devices

    jobs:
    job1:
    runs-on:
    - your-device-name1
    - your-device-name2
    steps:
    - name: step1
    run: echo step1...
  3. Run by device tag: Executes on a device corresponding to your-device-tag.

    jobs:
    job1:
    runs-on:
    - your-device-tag
    steps:
    - name: step1
    run: echo step1...
  4. Run by device tag and device name: Executes on a device corresponding to your-device-tag and a device with the name your-device-name.

    jobs:
    job1:
    runs-on:
    - your-device-tag
    - your-device-name
    steps:
    - name: step1
    run: echo step1...

Running on all devices with a specific device tag

group

Specify the device tag name. The job will run on all devices with that tag.

  1. Execute one device tag
    jobs:
    job1:
    runs-on:
    # Runs on all devices tagged with host
    group: host
    steps:
    - name: step1
    run: echo step1...
  2. Running multiple device tags
    jobs:
    job1:
    runs-on:
    # Runs on all devices tagged test1 and test2
    group:
    - test1
    - test2
    steps:
    - name: step1
    run: echo step1...
device tag

Documentation related to device tags can be found here.

jobs.<job-name>.needs

optional

Defines the order of job execution. The job specified in the needs property is executed first, followed by the current job.

Examples

# job1 runs first, then job2 runs.
jobs:
job1:
runs-on:
group: host
steps:
- name: step1
run: echo step1...

job2:
needs: job1
runs-on:
group: host
steps:
- name: step2
run: echo step2...
# job1 and job2 run concurrently. job3 will be executed after both job1 and job2 finish.
jobs:
job1:
runs-on:
group: host
steps:
- name: step1
run: echo step1...

job2:
runs-on:
group: host
steps:
- name: step1
run: echo step1...

job3:
needs:
- job1
- job2
runs-on:
group: host
steps:
- name: step2
run: echo step2..
# job1 and job2 run concurrently.
jobs:
job1:
runs-on:
group: host
steps:
- name: step1
run: echo step1...

job2:
runs-on:
group: android
steps:
- name: step1
run: echo step1...
Jobs running concurrently have the same runs-on
# job1 and job2 run concurrently.
jobs:
job1:
runs-on:
group: host
steps:
- name: step1
run: echo step1...

job2:
runs-on:
group: android
steps:
- name: step1
run: echo step1...

If, in the example above, job2 also specifies the "host" tag, both jobs are executed simultaneously, but the device with the "host" tag by job1 is in use, so it waits until job1 is finished. At this time, the order follows the Job order.

jobs.<job-name>.record

optional

Default: false


Defines whether to record the screen of the device when the Job is executed. If it is true, all devices defined in runs-on of the Job will record video.

Example

jobs:
job1:
runs-on:
group: android
# Record the screen of a device tagged with android.
record: true

jobs.<job-name>.browserName

optional

Default: null


info

This is an attribute for web testing. If it's not a web test, do not use it.

Select the browser to run in the job. You cannot select multiple browsers.

tip

If you want to run tests on multiple browsers, refer to the Routine Examples.

Possible browsers are as follows:

  • chrome
  • firefox
  • safari
  • edge

Example

jobs:
job1:
runs-on:
group: macos
browserName: chrome

jobs.<job-name>.appPackageName

optional

Default Value: null


Latest App

This uses the latest build version app of apps with the same package name.

info

This is an attribute for mobile app and game testing. Do not use it for other types of tests.

The app with this package name must be uploaded to the project.

Select the package name of the app to run in the job.

  1. If all platforms use the same package name:

    Example

    jobs:
    job1:
    runs-on:
    group: macos
    appPackageName: com.dogutech.app
  2. If each platform uses a different package name:

    Example

    jobs:
    job1:
    runs-on:
    group: macos
    appVersion:
    android: com.dogutech.app
    ios: com.dogutech.sample

jobs.<job-name>.appVersion (deprecated)

optional

Default: null


deprecated

For convenience, it is recommended to use jobs.<job-name>.appPackageName.

info

This is an attribute for mobile app and game testing. Do not use it for other types of tests.

The app version of the project must be uploaded.

Choose the version of the app to run in the job.

  1. If all platforms use the same version:

    Example

    jobs:
    job1:
    runs-on:
    group: macos
    appVersion: 1.0.0
  2. If each platform uses a different version:

    Example

    jobs:
    job1:
    runs-on:
    group: macos
    appVersion:
    android: 1.0.0
    ios: 1.0.1

jobs.<job-name>.steps

required

A list of steps to be executed in the Job. steps are always executed sequentially.

Properties

  • name: Defines the name of the step.
  • run: Defines a shell script action to be executed in the step.
  • uses: defines pre-defined actions to be used in the step.
  • env: Defines environment variables to be used in the step.
caution

If you use the uses attribute, you cannot use the run attribute.
If you use the run attribute, you cannot use the uses attribute.
One of the two must be defined.

Example

jobs:
job1:
runs-on:
group: host
steps:
- name: step1
run: echo step1...
env:
TEST: test

jobs.<job-name>.steps.<step-name>.name

required

Define the name of the step.

Example

jobs:
job1:
runs-on:
group: android
steps:
- name: step1

jobs.<job-name>.steps.<step-name>.uses

optional

Define Pre-defined Actions to be used in step.

caution

If you use the uses attribute, you cannot use the run attribute.
If you use the run attribute, you cannot use the uses attribute.
One of the two must be defined.

Example

jobs:
job1:
runs-on:
group: android
steps:
- name: step1
uses: dogu-actions/run-test

jobs.<job-name>.steps.<step-name>.with

optional

Defines pre-defined action arguments to be used in step.
Details of the actions provided by Dogu and their arguments can be found in the Pre-defined Actions document.

Example

jobs:
job1:
runs-on:
group: android
steps:
- name: step1
uses: dogu-actions/run-test
with:
environment: python

jobs.<job-name>.steps.<step-name>.cwd

optional

Defines the path for executing shell scripts in a step.

  1. When used with run:

    Example

    jobs:
    job1:
    runs-on:
    group: android
    steps:
    - name: step1
    cwd: ./my-project
    run: echo step1...
  2. When used with something like dogu-actions/run-test:

    Example

    jobs:
    job1:
    runs-on:
    group: android
    steps:
    - name: step1
    uses: dogu-actions/run-test
    cwd: ./my-project
    with:
    command: |
    npm install
    npm run test

jobs.<job-name>.steps.<step-name>.run

optional

Define shell script action to be executed in step.

caution

If you use the uses attribute, you cannot use the run attribute.
If you use the run attribute, you cannot use the uses attribute.
One of the two must be defined.

Example

jobs:
job1:
runs-on:
group: android
steps:
- name: step1
run: echo step1...

jobs.<job-name>.steps.<step-name>.env

optional

Define environment variables to be used in step. It can be defined in the form of key-value pairs.

Example

jobs:
job1:
runs-on:
group: android
steps:
- name: step1
env:
key1: value1
key2: value2

Environment variable priority

Environment variables have the following priority:

  1. Environment variable defined as env property in step
  2. Environment variables defined globally with the env attribute
name: test
# Environment variables defined globally in the routine
env:
key1: value1
key2: value2

jobs:
job1:
runs-on:
group: android
steps:
- name: step1
# environment variable defined in step
env:
key1: value3
key3: value4
run: echo step1...

In the example above, step1 uses the following environment variables.

key1: value3
key2: value2
key3: value4