Skip to content

Commit

Permalink
Add wait_for_boot option
Browse files Browse the repository at this point in the history
Refs #449
  • Loading branch information
dotdoom committed Oct 23, 2024
1 parent 9f1c121 commit fc6e8be
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 853 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## unreleased

- Add a `wait_for_boot` option (default false, preserving current behavior) to
wait for Simulator to finish booting the requested image before continuing.

## v3

- Breaking: change the default simulator from "model = iPhone 8" to "os = iOS",
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ a device with Apple Developer account, because a Simulator UDID
| `os` | `iOS`, `tvOS`, `watchOS` | OS type of the device |
| `os_version` | `>=14.0` | OS version specification in semver format |
| `udid` | `ABCD-EFGH` | Specific UDID you'd like to launch |
| `erase_before_boot` | `true` | Whether the data should be erased from device before boot. Starting for a clean state helps getting a stable environment for tests |
| `erase_before_boot` | `true` | Whether the data should be erased from device before boot. Starting from a clean state helps getting a stable environment for tests |
| `wait_for_boot` | `false` | Whether the action must wait for the Simulator to finish booting requested image |
| `shutdown_after_job` | `true` | Whether to shutdown the launched Simulator after the workflow job has been finished |

## Outputs
Expand Down
5 changes: 5 additions & 0 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ test('boots a device', () => {
cp.execFileSync(nodeProcess, [actionMain], options).toString()
).toContain('Booting device')

process.env['INPUT_WAIT_FOR_BOOT'] = 'true'
expect(
cp.execFileSync(nodeProcess, [actionMain], options).toString()
).toContain('Waiting for device to finish booting')

process.env['INPUT_MODEL'] = 'Pixel 4'
expect(() => cp.execFileSync(nodeProcess, [actionMain], options)).toThrow()
})
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ inputs:
description: Whether the Simulator data should be erased before booting
required: true
default: 'true'
wait_for_boot:
description: >
Whether the action must wait for the Simulator to finish booting requested
image
required: false
default: 'false'
shutdown_after_job:
description: >
Whether the Simulator should be shut down after the job has finished. This
Expand Down
Loading

0 comments on commit fc6e8be

Please sign in to comment.