Executes arbitrary tests within a given directory; it runs a shell script by default, but can also run pnpm (for NodeJS) or cargo (for Rust).
steps:
- uses: giancosta86/aurora-github/actions/run-custom-tests@v10
with:
root-directory: client-tests-
You should not call this action for unit tests when using verify-rust-crate or verify-npm-package - they are automatically run by the workflow itself.
-
This action is already called by verify-rust-wasm to optionally run the tests in the client-tests directory.
-
This action is already called by verify-npm-package to optionally run the tests in the tests directory.
-
If
root-directorydoes not exist:-
if
optionalis true, exit the action with no error -
otherwise, crash the workflow
-
-
Detect the test type and act accordingly:
-
If a file named like
script-fileexists in the root directory, run it usingscript-shell; consequently, there is no need to mark the file as executable -
Otherwise, if a file named package.json exists in the root directory:
-
run the verify script in the scripts section of package.json
-
Otherwise, if a file named Cargo.toml exists in the root directory:
-
if the rust-toolchain.toml file exists, run check-rust-versions to enforce a specific Rust toolkit
-
run
cargo testwith the--all-featuresflag
-
-
Otherwise:
-
if
optionalis true, exit the action with no error -
otherwise, crash the workflow
-
-
| Name | Type | Description | Default value |
|---|---|---|---|
optional |
boolean | Exit with no error if the tests cannot be run | false |
script-file |
string | Relative path to the script file | verify.sh |
script-shell |
string | The shell used to run script-file |
bash |
root-directory |
string | The directory containing the tests |