-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): Add section for Github actions in testing page (#664)
Co-authored-by: Andrew <[email protected]> Co-authored-by: Raghd Hamzeh <[email protected]>
- Loading branch information
1 parent
cbe4194
commit fea369c
Showing
1 changed file
with
26 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,6 +166,32 @@ $ fga model test --tests docs.fga.yaml | |
ⅹ ListObjects(user=user:peter,relation=admin,type=organization, context=&map[current_time:2024-02-01T00:10:00Z]): expected=[organization:acm], got=[organization:acme], error=<nil> | ||
``` | ||
|
||
## Running tests using GitHub Actions | ||
|
||
Use the [OpenFGA Model Testing Action](https://github.com/marketplace/actions/openfga-model-testing-action) to run tests from CI/CD flows in GitHub. | ||
|
||
Set the path to the `.fga.yaml` file as the `store-file-path` parameter when configuring the action: | ||
|
||
```yaml | ||
name: Test Action | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
test: | ||
name: Run test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: openfga/[email protected] | ||
with: | ||
store-file-path: ./example/model.fga.yaml | ||
``` | ||
|
||
## Related Sections | ||
|
||
<RelatedSection | ||
|