Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

The action outputs the results of the command as a JSON-formatted string that you can use this in subsequent steps in the same job. See [`results`](#results).

**Note:** On Ubuntu, this action only supports headless mode. Firefox and Chrome contexts automatically fall back to headless mode when necessary. If your tests doesn't work in headless mode (like if you need the 'startRecording' action), use macOS or Windows.
**Note:** On Ubuntu, this action only supports headless mode. Firefox and Chrome contexts automatically fall back to headless mode when necessary. If your tests doesn't work in headless mode (like if you need the `record` step), use macOS or Windows.

## Inputs

Expand Down Expand Up @@ -58,16 +58,6 @@ The working directory for the action, relative to the root of the repository. Th
working_directory: path/to/your/directory
```

### `command` (default: `runTests`)

The command to run. Valid values are "runTests" and "runCoverage".

```yaml
- uses: doc-detective/github-action@v1
with:
command: runCoverage
```

### `config`

The path to the configuration file.
Expand Down Expand Up @@ -130,7 +120,7 @@ Without the prebuild, iOS tests still work — the first XCUITest session builds

### `create_pr_on_change` (default: `false`)

Create a pull request if any files in the repo change, such as if screenshots or command results get updated. Only valid if `command` is `runTests`. Commits, branches, and pull requests are created with the credentials of the workflow run that triggered the action.
Create a pull request if any files in the repo change, such as if screenshots or command results get updated. Commits, branches, and pull requests are created with the credentials of the workflow run that triggered the action.

```yaml
- uses: doc-detective/github-action@v1
Expand Down Expand Up @@ -245,7 +235,7 @@ Whatever this is set to, the job also fails if Doc Detective exits non-zero, suc

### `create_issue_on_fail` (default: `false`)

Create a GitHub issue if one or more tests fails. Only valid if `command` is `runTests`.
Create a GitHub issue if one or more tests fails.

```yaml
- uses: doc-detective/github-action@v1
Expand Down Expand Up @@ -283,9 +273,9 @@ The title of the created GitHub issue. Only valid if `create_issue_on_fail` is s
issue_title: Doc Detective found issues in the documentation
```

### `issue_body` (default: `Doc Detective run failed with the following results:$RESULTS`)
### `issue_body` (default: `A Doc Detective run ($RUN_URL) failed with the following results:$RESULTS`)

The body of the created GitHub issue. Use the `$RESULTS` variable to insert the results object. Only valid if `create_issue_on_fail` is set to `true`.
The body of the created GitHub issue. Use the `$RESULTS` variable to insert the results object, and `$RUN_URL` to insert the URL of the workflow run that created the issue. Only valid if `create_issue_on_fail` is set to `true`.

GitHub limits issue bodies to 65,536 characters. If the body would be longer, `$RESULTS` gets cut to fit, and a note links to the workflow run.

Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
required: false
default: auto
ios:
description: 'DEPRECATED — no-op. Doc Detective (v4.28+) prebuilds and manages the WebDriverAgent build itself, keyed by Xcode and XCUITest driver versions. For fast iOS runs, execute `npx doc-detective install ios --yes` with a persisted cache directory (DOC_DETECTIVE_CACHE_DIR + actions/cache) before this action: https://doc-detective.com/docs/ci/github-action#speed-up-ios-tests-on-macos. iOS tests still work without it — the first session builds WebDriverAgent in-session when no prebuilt products exist.'
description: 'DEPRECATED — no-op. Doc Detective (v4.28+) prebuilds and manages the WebDriverAgent build itself, keyed by Xcode and XCUITest driver versions. For fast iOS runs, execute `npx doc-detective install ios --yes` with a persisted cache directory (DOC_DETECTIVE_CACHE_DIR + actions/cache) before this action: https://docs.doc-detective.com/docs/ci/github-action#speed-up-ios-tests-on-macos. iOS tests still work without it — the first session builds WebDriverAgent in-session when no prebuilt products exist.'
required: false
default: auto
config:
Expand All @@ -25,7 +25,7 @@ inputs:
description: Path to the input file or directory. Overrides the "input" field in the config file.
required: false
create_pr_on_change:
description: Create a pull request if any files in the repo change, such as if screenshots or command results get updated. Default is "false". Only valid for the "runTests" command.
description: Create a pull request if any files in the repo change, such as if screenshots or command results get updated. Default is "false".
required: false
default: "false"
pr_branch:
Expand Down Expand Up @@ -58,7 +58,7 @@ inputs:
description: Fail the job if one or more tests fails. An empty value means "false", with a notice that `doc-detective/github-action@v2` defaults this to "true". Whatever this is set to, the job also fails if Doc Detective exits non-zero, after the results, issue, and pull request steps run.
required: false
create_issue_on_fail:
description: Create a GitHub issue if one or more tests fails. Default is "false". Only valid for the "runTests" command.
description: Create a GitHub issue if one or more tests fails. Default is "false".
required: false
default: "false"
issue_title:
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24560,7 +24560,7 @@ function shouldNoticeRetiredWdaCache({
if (value === "true") return { notify: true, reason: "ios input is true" };
return scan(roots) ? { notify: true, reason: "auto-detected an ios platform in your specs" } : { notify: false, reason: "no ios platform detected in specs" };
}
var WDA_CACHE_RETIREMENT_NOTICE = "The `ios` WebDriverAgent build cache was retired: Doc Detective v4.28+ prebuilds and manages WDA itself, keyed by your Xcode and driver versions. Upgrade to v4.28+ if necessary, then run `npx doc-detective install ios --yes` with a persisted cache directory before this action \u2014 see https://doc-detective.com/docs/ci/github-action#speed-up-ios-tests-on-macos. The `ios` input is now a no-op; iOS tests still work and build WebDriverAgent in-session when no prebuilt products exist.";
var WDA_CACHE_RETIREMENT_NOTICE = "The `ios` WebDriverAgent build cache was retired: Doc Detective v4.28+ prebuilds and manages WDA itself, keyed by your Xcode and driver versions. Upgrade to v4.28+ if necessary, then run `npx doc-detective install ios --yes` with a persisted cache directory before this action \u2014 see https://docs.doc-detective.com/docs/ci/github-action#speed-up-ios-tests-on-macos. The `ios` input is now a no-op; iOS tests still work and build WebDriverAgent in-session when no prebuilt products exist.";

// src/index.ts
var meta = { dist_interface: "github-actions" };
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/iosSetup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@ import {
textRequestsIos,
scanForIos,
shouldNoticeRetiredWdaCache,
WDA_CACHE_RETIREMENT_NOTICE,
} from "./iosSetup.ts";

test("the retirement notice links to the docs site, not the redirecting host", () => {
const url = WDA_CACHE_RETIREMENT_NOTICE.match(/https:\/\/\S+?(?=\.?\s|$)/)?.[0];
assert.equal(
url,
"https://docs.doc-detective.com/docs/ci/github-action#speed-up-ios-tests-on-macos"
);
});

test("textRequestsIos matches the platform field forms", () => {
assert.equal(textRequestsIos('{"platform": "ios"}'), true);
assert.equal(textRequestsIos('{"platforms": "ios"}'), true);
Expand Down
2 changes: 1 addition & 1 deletion src/iosSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ export function shouldNoticeRetiredWdaCache({

/** The migration notice shown once per run in place of the retired cache. */
export const WDA_CACHE_RETIREMENT_NOTICE =
"The `ios` WebDriverAgent build cache was retired: Doc Detective v4.28+ prebuilds and manages WDA itself, keyed by your Xcode and driver versions. Upgrade to v4.28+ if necessary, then run `npx doc-detective install ios --yes` with a persisted cache directory before this action — see https://doc-detective.com/docs/ci/github-action#speed-up-ios-tests-on-macos. The `ios` input is now a no-op; iOS tests still work and build WebDriverAgent in-session when no prebuilt products exist.";
"The `ios` WebDriverAgent build cache was retired: Doc Detective v4.28+ prebuilds and manages WDA itself, keyed by your Xcode and driver versions. Upgrade to v4.28+ if necessary, then run `npx doc-detective install ios --yes` with a persisted cache directory before this action — see https://docs.doc-detective.com/docs/ci/github-action#speed-up-ios-tests-on-macos. The `ios` input is now a no-op; iOS tests still work and build WebDriverAgent in-session when no prebuilt products exist.";
Loading