Skip to content

Commit 5f6596d

Browse files
committed
Updated README
1 parent 6377828 commit 5f6596d

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ Over time, numerous quirks and edge cases of both GitHub actions runners and how
1010

1111
This acton is designed as a one-stop shop to select and prepare a device simulator, primarily with the intention of running unit tests on the simulator.
1212

13-
## Parameters
13+
## Input Parameters
1414

1515
| Name | Required | Description | Format |
1616
| ---------------- | -------- | ------------------------------------------------------------ | ---------------------------- |
1717
| `refresh` | No | Refresh Xcode simulators by first calling the simulator controller to refresh by listing all local simulators. | `true` or `false` |
1818
| `download` | No | Asks the simulator controller to first download a relevant simulator for the platform specified by the target parameter. | `true` or `false` |
19-
| `workspace-path` | No | Relative path to the Xcode workspace. If the target is a Swift Package that exists in the root of the repository, omit this parameter. | Relative path from repo root |
19+
| `workspace-path` | No | Relative Xcode workspace path. If the target is a Swift Package that exists in the root of the repository, omit this parameter. | Relative path from repo root |
2020
| `scheme` | Yes | Xcode scheme name that will be used when enumerating available device simulators. | String |
2121
| `target` | Yes | Target identifier (case-insensitive). See table below for full list of identifiers. | String |
2222
| `os-version` | No | Platform OS version (regular expression). | String |
@@ -50,6 +50,17 @@ Target identifiers supported, with tables listed in increasing degree of specifi
5050
| `watch-se` | watchOS | Newest Apple Watch SE simulator | Newest OS version, unless specified |
5151
| `watch-series` | watchOS | Newest Apple Watch Series simulator | Newest OS version, unless specified |
5252

53+
## Output Parameters
54+
55+
The action outputs the following parameters:
56+
57+
| Name | Description | Example |
58+
| ---------------------- | ------------------------------------------------------------ | -------------------------------------- |
59+
| `id` | Verbatim simulator ID, usable in `xcodebuild test` destination. | `17FC425F-F336-48DC-8D5A-05DA7BCF7B7D` |
60+
| `platform` | Verbatim platform name, usable in `xcodebuild test` destination. | `iOS Simulator` |
61+
| `platform-short` | Short platform name, usable in `xcodebuild build` generic destinations. | `iOS` |
62+
| `workspace-path` | Xcode workspace path relative to repo root | `Foo/Foo.xcodeproj/project.xcworkspace` |
63+
5364
## Usage
5465

5566
Prepare an iOS device simulator (defaults to iPhone) using the latest device and operating system version in order to test a Swift Package:
@@ -106,7 +117,6 @@ Prepare an iOS device simulator (defaults to iPhone) using the latest device and
106117
```yaml
107118
env:
108119
SCHEME: "MySchemeName"
109-
WORKSPACEPATH: ".swiftpm/xcode/package.xcworkspace" # Standard workspace location for Swift Package
110120
111121
jobs:
112122
build:
@@ -126,15 +136,20 @@ jobs:
126136
xcodebuild build \
127137
-workspace "$WORKSPACEPATH" \
128138
-scheme "$SCHEME" \
129-
-destination "generic/platform=iOS"
139+
-destination "generic/platform=$PLATFORMSHORT"
140+
env:
141+
PLATFORMSHORT: ${{ steps.prep-sim.outputs.platform-short }}
142+
WORKSPACEPATH: ${{ steps.prep-sim.outputs.workspace-path }}
130143
- name: Unit Test
131144
run: |
132145
xcodebuild test \
133146
-workspace "$WORKSPACEPATH" \
134147
-scheme "$SCHEME" \
135-
-destination "platform=iOS Simulator,id=$DESTID"
148+
-destination "platform=$PLATFORM,id=$ID"
136149
env:
137-
DESTID: ${{ steps.prep-sim.outputs.id }}
150+
ID: ${{ steps.prep-sim.outputs.id }}
151+
PLATFORM: ${{ steps.prep-sim.outputs.platform }}
152+
WORKSPACEPATH: ${{ steps.prep-sim.outputs.workspace-path }}
138153
```
139154

140155
## Documentation

0 commit comments

Comments
 (0)