feat: add plugin for cerbos client #692
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2024 Dyne.org foundation | |
| # | |
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| name: π§ͺ Lint and test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| reuse: | |
| name: π¨ reuse | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: fsfe/reuse-action@v5 | |
| build_and_test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 1 | |
| matrix: | |
| node: [ lts/*, 25.1.0 ] | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: π οΈ Prepare pnpm workspace | |
| uses: dyne/pnpm@main | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - uses: supercharge/redis-github-action@1.8.0 | |
| with: | |
| redis-version: 6 | |
| - name: Linting | |
| continue-on-error: true | |
| run: pnpm lint | |
| - name: π€ Start pocketbase | |
| run: | | |
| ./pkg/pocketbase/test/pocketbase serve & | |
| while ! nc -z 0.0.0.0 8090; do echo "pocketbase not ready" && sleep 1; done | |
| - name: π€ Start microservices | |
| run: | | |
| ./pkg/oauth/test/start_microservices.sh setup | |
| - name: π€ Start ganache | |
| run: | | |
| pnpm exec ganache \ | |
| --server.host 0.0.0.0 \ | |
| --server.port 9485 \ | |
| --chain.chainId 1717658228 \ | |
| --wallet.seed "spoon ostrich survey tumble tube used person also wasp rack cabbage liberty" & | |
| working-directory: ./pkg/ethereum | |
| - name: π€ Start cerbos | |
| run: | | |
| pnpm exec cerbos server --config=./test/.cerbos.yaml & | |
| working-directory: ./pkg/cerbos | |
| - name: π§ͺ Run the tests | |
| run: pnpm coverage | |
| - name: π§ͺ Test grammar package | |
| run: pnpm test:grammar | |
| - name: π¨ Setup playwright | |
| run: | | |
| pnpm exec playwright install | |
| pnpm exec playwright install-deps | |
| pnpm build | |
| pnpm exec playwright test | |
| working-directory: ./pkg/browser | |
| - name: πͺ¦ kill local microservices | |
| run: | | |
| ./pkg/oauth/test/start_microservices.sh cleanup | |
| build_docs: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: π οΈ Prepare pnpm workspace | |
| uses: dyne/pnpm@main | |
| - name: π Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: ποΈ update sentences tabled and build the docs | |
| run: pnpm build && pnpm run docs | |
| - name: β« Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: docs/.vitepress/dist | |
| deploy_docs: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: build_docs | |
| runs-on: ubuntu-latest | |
| name: Deploy documentation | |
| steps: | |
| - name: π‘ Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: π οΈ Prepare pnpm workspace | |
| uses: dyne/pnpm@main | |
| - name: ποΈ Build all | |
| run: pnpm build | |
| - name: π Build @slangroom/browser | |
| run: pnpm build | |
| working-directory: ./pkg/browser | |
| - name: π¦ Releases | |
| run: | | |
| git config --global user.email "dev@dyne.org" && git config --global user.name "Dev Dyne.org" | |
| echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc | |
| pnpm whoami | |
| pnpm publish:ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |