Skip to content

Commit

Permalink
Merge pull request #13 from closetool/master
Browse files Browse the repository at this point in the history
fix: add github action
  • Loading branch information
hsluoyz committed Jun 4, 2021
2 parents c297c0e + 9d4cc59 commit 902fb28
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
@@ -0,0 +1,55 @@
name: Go
on: [push,pull_request]

jobs:

test:

strategy:
matrix:
go: [1.14,1.15,1.16]

runs-on: ubuntu-latest
services:
casbin:
image: quay.io/coreos/etcd
ports:
- 2379:2379
- 2380:2380
env:
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- uses: actions/checkout@v2
- name: Run Unit tests
run: go test -v -coverprofile=profile.cov ./...

- name: Install goveralls
env:
GO111MODULE: off
run: go get github.com/mattn/goveralls

- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=profile.cov -service=github

semantic-release:
needs: [test]
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Run semantic-release
if: github.repository == 'casbin/etcd-watcher' && github.event_name == 'push'
run: |
npm install --save-dev semantic-release@17.2.4
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .releaserc.json
@@ -0,0 +1,16 @@
{
"debug": true,
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github"
]
}
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
Etcd Watcher [![Build Status](https://travis-ci.org/casbin/etcd-watcher.svg?branch=master)](https://travis-ci.org/casbin/etcd-watcher) [![Coverage Status](https://coveralls.io/repos/github/casbin/etcd-watcher/badge.svg?branch=master)](https://coveralls.io/github/casbin/etcd-watcher?branch=master) [![Godoc](https://godoc.org/github.com/casbin/etcd-watcher?status.svg)](https://godoc.org/github.com/casbin/etcd-watcher)
Etcd Watcher [![Go](https://github.com/casbin/etcd-watcher/actions/workflows/test.yml/badge.svg)](https://github.com/casbin/etcd-watcher/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/casbin/etcd-watcher/badge.svg?branch=master)](https://coveralls.io/github/casbin/etcd-watcher?branch=master) [![Godoc](https://godoc.org/github.com/casbin/etcd-watcher?status.svg)](https://godoc.org/github.com/casbin/etcd-watcher)
====

Etcd Watcher is the [Etcd](https://github.com/coreos/etcd) watcher for [Casbin](https://github.com/casbin/casbin). With this library, Casbin can synchronize the policy with the database in multiple enforcer instances.
Expand Down

0 comments on commit 902fb28

Please sign in to comment.