Skip to content

Commit

Permalink
feat(docs): Add section for Github actions in testing page (#664)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew <[email protected]>
Co-authored-by: Raghd Hamzeh <[email protected]>
  • Loading branch information
3 people authored Feb 26, 2024
1 parent cbe4194 commit fea369c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/content/modeling/testing-models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fea369c

Please sign in to comment.