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
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Intelligently retries failed PHPUnit tests with their dependencies instead of running the full test suite.

**Please note that this action is not a drop-in replacement for standard PHPUnit retries.**
**Originally designed for Appwrite Cloud's internal test infrastructure and may require minor adjustments for other setups.**
**Originally designed for Appwrite Cloud's internal test infrastructure and may require minor adjustments for other
setups.**

## Usage

Expand Down Expand Up @@ -34,14 +35,16 @@ Intelligently retries failed PHPUnit tests with their dependencies instead of ru

## Inputs

| Input | Required | Default | Description |
|----------------------|----------|---------|------------------------------------------------------------|
| `command` | Yes | - | PHPUnit command to execute |
| `test_dir` | Yes | - | Test directory in workspace |
| `max_attempts` | No | `3` | Maximum retry attempts (1-10) |
| `retry_wait_seconds` | No | `10` | Seconds to wait between retries |
| `shell` | No | `bash` | Shell: `bash`, `sh`, `pwsh`, `python`, `cmd`, `powershell` |
| `timeout_minutes` | No | `30` | Timeout per attempt (0 = no timeout) |
| Input | Required | Default | Description |
|----------------------|----------|---------|------------------------------------------------------------------------------------|
| `command` | Yes | - | PHPUnit command to execute |
| `test_dir` | Yes | - | Test directory in workspace |
| `max_attempts` | No | `3` | Maximum retry attempts (1-10) |
| `retry_wait_seconds` | No | `10` | Seconds to wait between retries |
| `shell` | No | `bash` | Shell: `bash`, `sh`, `pwsh`, `python`, `cmd`, `powershell` |
| `timeout_minutes` | No | `30` | Timeout per attempt (0 = no timeout) |
| `github_token` | No | - | GitHub token for PR comments (requires `pull-requests: write` and `content: read`) |
| `job_id` | No | - | Job ID to build URLs for Job logs |

## Notes

Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ inputs:
test_dir:
description: 'Base directory for test files in workspace (e.g., "tests" or "vendor/appwrite/server-ce/tests")'
required: true
github_token:
description: 'GitHub token for posting PR comments with test summary. Ensure workflow/job has permissions: contents: read, pull-requests: write'
required: false
job_id:
description: 'GitHub Actions job ID for linking to specific workflow run job (optional, will auto-fetch if github_token has actions: read permission, or pass job ID explicitly)'
required: false

outputs:
total_attempts:
Expand Down
43 changes: 43 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 73 additions & 39 deletions dist/index.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"prebuild": "bun check",
"build": "bun build ./src/index.ts --minify --target node --format cjs --outdir ./dist",
"format": "prettier --write 'src/**/*.ts'",
"lint": "prettier --check 'src/**/*.ts'",
"format": "prettier --write '{src,tests}/**/*.ts'",
"lint": "prettier --check '{src,tests}/**/*.ts'",
"test": "bun test",
"test:unit": "bun test tests/unit/",
"test:integration": "bun run tests/integration/index.ts",
Expand All @@ -27,6 +27,7 @@
"dependencies": {
"@actions/core": "^2.0.1",
"@actions/exec": "^2.0.0",
"@actions/github": "^6.0.0",
"fast-xml-parser": "^5.3.3",
"tree-kill": "^1.2.2"
}
Expand Down
Loading