virtual360-io/Selective Tests
Compute the Minitest tests affected by a diff using the selective_tests manifest committed at the project root. Outputs a newline-separated list of test files for the calling workflow to feed into its test runner.
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Stale
- License
- None
Inputs
| name | description | required | default |
|---|---|---|---|
| base-ref | Branch to diff against. The action computes `git diff --name-only origin/<base-ref>...HEAD`. | no | develop |
| changed-files | Optional newline- or space-separated list of changed files. When set, the action skips the git diff and uses this list directly. Useful when the caller already has the diff (e.g. `tj-actions/changed-files`). | no | "" |
| manifest-dir | Path (relative to the repository root) to the manifest directory written by `TRACK_TEST_FILES=true bundle exec rails test`. | no | .selective_tests |
| bundler-cmd | Command used to invoke the CLI. Override when the gem is not installed via bundler (e.g. `selective-tests` if installed globally) or when the caller bundles with a non-default Gemfile. | no | bundle exec selective-tests |
| strict | When `true`, the action fails if the diff contains any file not present in the manifest. When `false` (default), unknown files are reported on the job log but do not fail the step. | no | false |
| output-file | Optional path where the list of selected tests will be written, one per line. Useful for piping into a downstream `xargs` step. | no | "" |
Outputs
| name | description |
|---|---|
| tests | Newline-separated list of selected test files. Empty when no tests are affected, when the manifest is missing, or when the diff is empty. |
| test-count | Number of test files selected. `0` means no tests are affected and the caller may skip the test job entirely. |
| manifest-found | `true` when `manifest-dir` contains either a consolidated `manifest.json` or at least one `run-*.ndjson`. `false` means the caller should fall back to running the full suite. |
| unknown-count | Number of files in the diff that are unknown to the manifest. They are conservatively skipped; bump this number is a signal that the manifest is stale. |
| diff-file-count | Number of files in the input diff (after git or `changed-files`). |