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
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
go-version: [ '1.23' ]

services:
etcd:
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: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Test
run: go test -covermode atomic -coverprofile=covprofile ./...

- 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=covprofile -service=github

semantic-release:
needs: [test]
if: github.repository == 'casbin/etcd-watcher' && github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Install semantic-release
run: npm install --save-dev semantic-release@21.0.0 @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github

- name: Run semantic-release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59 changes: 0 additions & 59 deletions .github/workflows/test.yml

This file was deleted.

10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
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
====

[![Go Report Card](https://goreportcard.com/badge/github.com/casbin/etcd-watcher)](https://goreportcard.com/report/github.com/casbin/etcd-watcher)
[![Go](https://github.com/casbin/etcd-watcher/actions/workflows/ci.yml/badge.svg)](https://github.com/casbin/etcd-watcher/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/casbin/etcd-watcher/badge.svg?branch=master)](https://coveralls.io/github/casbin/etcd-watcher?branch=master)
[![Go Reference](https://pkg.go.dev/badge/github.com/casbin/etcd-watcher/v2.svg)](https://pkg.go.dev/github.com/casbin/etcd-watcher/v2)
[![Release](https://img.shields.io/github/release/casbin/etcd-watcher.svg)](https://github.com/casbin/etcd-watcher/releases/latest)
[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN)
[![Sourcegraph](https://sourcegraph.com/github.com/casbin/etcd-watcher/-/badge.svg)](https://sourcegraph.com/github.com/casbin/etcd-watcher?badge)

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.

## Installation
Expand Down
Loading