From fea369c20ac6ad75edf76a6369803a3c5bd70c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Aguiar?= Date: Mon, 26 Feb 2024 19:33:29 -0300 Subject: [PATCH] feat(docs): Add section for Github actions in testing page (#664) Co-authored-by: Andrew <109249228+pavokta@users.noreply.github.com> Co-authored-by: Raghd Hamzeh --- docs/content/modeling/testing-models.mdx | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/content/modeling/testing-models.mdx b/docs/content/modeling/testing-models.mdx index fb996b9cc..f6225d417 100644 --- a/docs/content/modeling/testing-models.mdx +++ b/docs/content/modeling/testing-models.mdx @@ -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= ``` +## 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/action-openfga-test@v0.1 + with: + store-file-path: ./example/model.fga.yaml + +``` + ## Related Sections