feat: add PrismaAdapter.newAdapter(prisma) constructor and fix prisma… #137
  
    
      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
    
  
  
    
  | name: ci | |
| on: [push, pull_request] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:latest | |
| ports: | |
| - 3306:3306 | |
| env: | |
| MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| - run: mysql --host 127.0.0.1 --port 3306 -uroot -p -e "source ./prisma/casbin_rule.sql" | |
| - run: npm i | |
| - run: npx prisma generate | |
| - run: npm run format:check | |
| - run: npm run lint | |
| - run: npx jest --coverage --forceExit | |
| - name: Coveralls Parallel | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| finish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Coveralls Finished | |
| uses: coverallsapp/github-action@master | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| parallel-finished: true | |
| - uses: actions/checkout@v2 | |
| - run: npm i | |
| - run: npm run build | |
| - name: Release | |
| if: github.event_name == 'push' && github.repository == 'node-casbin/prisma-adapter' | |
| run: npx semantic-release | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |