Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
name: Benchmarks

on: [push, pull_request]

permissions:
contents: read

jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [^14, ^16, ^18]
node-version: [^18, ^20]
steps:
- uses: actions/checkout@v2
- run: yarn install && yarn global add ts-node
- run: yarn benchmark
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependency
run: yarn install && yarn global add ts-node

- name: Run Benchmark
run: yarn benchmark
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on: [push, pull_request]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ^20

- name: Install Dependency
run: yarn install

- name: Run Lint
run: yarn run lint

coverage:
needs: [lint]
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ^20

- name: Install Dependency
run: yarn install

- name: Run Coverage
run: yarn run coverage

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

test:
needs: [lint]
runs-on: ubuntu-latest
strategy:
matrix:
node: [^18, ^20]
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install Dependency
run: yarn install

- name: Run Unit test
run: yarn run test

- name: Run Build
run: yarn run build
64 changes: 0 additions & 64 deletions .github/workflows/main.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/platform_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Platform Test

on: [push, pull_request]

permissions:
contents: read

jobs:
reactjs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [^18, ^20]
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build casbin-core
run: yarn install && yarn build && yarn link

- name: Install and link React.js test
run: cd test/reactjs && yarn install && yarn link casbin-core

- name: Run React.js test
run: cd test/reactjs && yarn test

- name: Build React.js test
run: cd test/reactjs && yarn build

reactnative:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [^18, ^20]
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build casbin-core
run: yarn install && yarn build && yarn link

- name: Install React Native test dependencies
run: cd test/reactnative && yarn install && yarn global add jest

- name: Run React Native test
run: cd test/reactnative && yarn test

angular:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [^18, ^20]
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build casbin-core
run: yarn install && yarn build && yarn link

- name: Install Angular CLI
run: yarn global add @angular/cli

- name: Install and link Angular test
run: cd test/angular && yarn install && yarn link casbin-core

- name: Run Angular test
run: cd test/angular && ng test --watch=false --browsers=ChromeHeadless

- name: Build Angular test
run: cd test/angular && yarn build
39 changes: 0 additions & 39 deletions .github/workflows/platfrom_test.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverage
lib
es
dist

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Casbin-Core

[![CI](https://github.com/casbin/casbin-core/actions/workflows/ci.yml/badge.svg)](https://github.com/casbin/casbin-core/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/casbin/casbin-core/badge.svg?branch=main)](https://coveralls.io/github/casbin/casbin-core?branch=main)
[![NPM version][npm-image]][npm-url]
[![NPM download][download-image]][download-url]
[![install size](https://packagephobia.now.sh/badge?p=casbin-core)](https://packagephobia.now.sh/result?p=casbin-core)
[![codebeat badge](https://codebeat.co/badges/c17c9ee1-da42-4db3-8047-9574ad2b23b1)](https://codebeat.co/projects/github-com-casbin-casbin-core-main)
[![GitHub Actions](https://github.com/casbin/casbin-core/workflows/main/badge.svg)](https://github.com/casbin/node-casbin/actions)
[![Coverage Status](https://coveralls.io/repos/github/casbin/node-casbin/badge.svg?branch=main)](https://coveralls.io/github/casbin/casbin-core?branch=main)
[![Release](https://img.shields.io/github/release/casbin/casbin-core.svg)](https://github.com/casbin/casbin-core/releases/latest)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/casbin/lobby)
[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN)

[npm-image]: https://img.shields.io/npm/v/casbin-core.svg?style=flat-square
[npm-url]: https://npmjs.org/package/casbin-core
[npm-url]: https://npmjs.com/package/casbin-core
[download-image]: https://img.shields.io/npm/dm/casbin-core.svg?style=flat-square
[download-url]: https://npmjs.org/package/casbin-core
[download-url]: https://npmjs.com/package/casbin-core

**News**: still worry about how to write the correct `casbin-core` policy? [Casbin online editor](http://casbin.org/en/editor) is coming to help!

Expand Down
Loading
Loading