Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ee86b2

Browse files
authored
ci: migrate from travis to github actions (apache#216)
Signed-off-by: Zixuan Liu <[email protected]>
1 parent b379bdf commit 3ee86b2

4 files changed

Lines changed: 51 additions & 29 deletions

File tree

.github/workflows/main.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: main
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
node-version: [^10, ^12, ^14]
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- uses: actions/setup-node@v1
14+
with:
15+
node-version: ${{ matrix.node-version }}
16+
- run: yarn install --ignore-engines
17+
- run: yarn lint
18+
- run: yarn test
19+
- run: yarn coverage
20+
- name: Coveralls
21+
uses: coverallsapp/github-action@master
22+
with:
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
24+
flag-name: run-${{ matrix.node-version }}
25+
parallel: true
26+
27+
semantic-release:
28+
needs: [test]
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
33+
- name: Run semantic-release
34+
if: github.repository == 'casbin/node-casbin' && github.event_name == 'push'
35+
run: yarn install --no-lockfile && yarn semantic-release
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
40+
finish:
41+
needs: test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Coveralls Finished
45+
uses: coverallsapp/github-action@master
46+
with:
47+
github-token: ${{ secrets.github_token }}
48+
parallel-finished: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules
44
lib
55
yarn-error.log
66
package-lock.json
7+
coverage

.travis.yml

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"fmt": "eslint . --ext .js,.ts --fix",
1717
"semantic-release": "semantic-release",
1818
"commit": "git-cz",
19-
"clean": "rimraf lib"
19+
"clean": "rimraf lib",
20+
"coverage": "jest --coverage"
2021
},
2122
"devDependencies": {
2223
"@semantic-release/changelog": "^3.0.6",

0 commit comments

Comments
 (0)