-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: support multiple test files (#8)
* feat!: support multiple test files * ci: run test workflow on PR
- Loading branch information
Showing
3 changed files
with
81 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,38 @@ | |
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-test.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fopenfga%2Faction-openfga-test?ref=badge_shield) | ||
|
||
|
||
This action can be used to test your authorization model using a store file. | ||
This action can be used to test your authorization model using store test files. | ||
|
||
## Parameter | ||
|
||
| Parameter | Description | | ||
|----------|--------------| | ||
| `store-file-path` | The path to your store file relative to the root of your project | | ||
| Parameter | Description | Required | Default | | ||
|----------------------|----------------------------------------------------------------------------------|----------|--------------| | ||
| `test_path` | The path to your store test file or folder relative to the root of your project. | No | `.` | | ||
| `test_files_pattern` | The pattern to match test files. | No | `*.fga.yaml` | | ||
|
||
## Example | ||
> Note: the action will fail if no test is found in the specified test path with the given pattern | ||
|
||
## Examples | ||
|
||
|
||
### Running tests of `*.fga.yaml` files present in the repository | ||
|
||
```yaml | ||
name: Test Action | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
name: Run test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: openfga/[email protected] | ||
``` | ||
### Running tests of `*.fga.yaml` files present in a given folder | ||
|
||
```yaml | ||
name: Test Action | ||
|
@@ -25,7 +48,25 @@ jobs: | |
steps: | ||
- uses: openfga/[email protected] | ||
with: | ||
store-file-path: ./example/model.fga.yaml | ||
test_path: example | ||
``` | ||
|
||
### Running tests of a single file | ||
|
||
```yaml | ||
name: Test Action | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
test: | ||
name: Run test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: openfga/[email protected] | ||
with: | ||
test_path: example/model.fga.yaml | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters