Skip to content

Commit 9b50d04

Browse files
authored
feat: modernize CI workflows and README badges, regenerate yarn.lock (#19)
1 parent 2522ae8 commit 9b50d04

File tree

8 files changed

+2701
-1944
lines changed

8 files changed

+2701
-1944
lines changed

.github/workflows/benchmark.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
name: Benchmarks
2+
23
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
38
jobs:
49
benchmark:
510
runs-on: ubuntu-latest
611
strategy:
712
fail-fast: false
813
matrix:
9-
node-version: [^14, ^16, ^18]
14+
node-version: [^18, ^20]
1015
steps:
11-
- uses: actions/checkout@v2
12-
- run: yarn install && yarn global add ts-node
13-
- run: yarn benchmark
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- name: Install Dependency
24+
run: yarn install && yarn global add ts-node
25+
26+
- name: Run Benchmark
27+
run: yarn benchmark

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: ^20
18+
19+
- name: Install Dependency
20+
run: yarn install
21+
22+
- name: Run Lint
23+
run: yarn run lint
24+
25+
coverage:
26+
needs: [lint]
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: read
30+
pull-requests: write
31+
steps:
32+
- uses: actions/checkout@v3
33+
34+
- name: Set up Node.js
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: ^20
38+
39+
- name: Install Dependency
40+
run: yarn install
41+
42+
- name: Run Coverage
43+
run: yarn run coverage
44+
45+
- name: Coveralls
46+
uses: coverallsapp/github-action@master
47+
with:
48+
github-token: ${{ secrets.GITHUB_TOKEN }}
49+
50+
test:
51+
needs: [lint]
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
node: [^18, ^20]
56+
steps:
57+
- uses: actions/checkout@v3
58+
59+
- name: Set up Node.js
60+
uses: actions/setup-node@v3
61+
with:
62+
node-version: ${{ matrix.node }}
63+
64+
- name: Install Dependency
65+
run: yarn install
66+
67+
- name: Run Unit test
68+
run: yarn run test
69+
70+
- name: Run Build
71+
run: yarn run build

.github/workflows/main.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Platform Test
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
reactjs:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
node-version: [^18, ^20]
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
23+
- name: Build casbin-core
24+
run: yarn install && yarn build && yarn link
25+
26+
- name: Install and link React.js test
27+
run: cd test/reactjs && yarn install && yarn link casbin-core
28+
29+
- name: Run React.js test
30+
run: cd test/reactjs && yarn test
31+
32+
- name: Build React.js test
33+
run: cd test/reactjs && yarn build
34+
35+
reactnative:
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
node-version: [^18, ^20]
41+
steps:
42+
- uses: actions/checkout@v3
43+
44+
- name: Set up Node.js
45+
uses: actions/setup-node@v3
46+
with:
47+
node-version: ${{ matrix.node-version }}
48+
49+
- name: Build casbin-core
50+
run: yarn install && yarn build && yarn link
51+
52+
- name: Install React Native test dependencies
53+
run: cd test/reactnative && yarn install && yarn global add jest
54+
55+
- name: Run React Native test
56+
run: cd test/reactnative && yarn test
57+
58+
angular:
59+
runs-on: ubuntu-latest
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
node-version: [^18, ^20]
64+
steps:
65+
- uses: actions/checkout@v3
66+
67+
- name: Set up Node.js
68+
uses: actions/setup-node@v3
69+
with:
70+
node-version: ${{ matrix.node-version }}
71+
72+
- name: Build casbin-core
73+
run: yarn install && yarn build && yarn link
74+
75+
- name: Install Angular CLI
76+
run: yarn global add @angular/cli
77+
78+
- name: Install and link Angular test
79+
run: cd test/angular && yarn install && yarn link casbin-core
80+
81+
- name: Run Angular test
82+
run: cd test/angular && ng test --watch=false --browsers=ChromeHeadless
83+
84+
- name: Build Angular test
85+
run: cd test/angular && yarn build

.github/workflows/platfrom_test.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ coverage
88
lib
99
es
1010
dist
11+

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Casbin-Core
22

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

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

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

0 commit comments

Comments
 (0)