Skip to content

Commit 959e50d

Browse files
authored
feat: improve CI and README badges (#33)
1 parent f24b286 commit 959e50d

File tree

3 files changed

+81
-60
lines changed

3 files changed

+81
-60
lines changed

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
go-version: [ '1.23' ]
18+
19+
services:
20+
etcd:
21+
image: quay.io/coreos/etcd
22+
ports:
23+
- 2379:2379
24+
- 2380:2380
25+
env:
26+
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
27+
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v3
32+
33+
- name: Set up Go
34+
uses: actions/setup-go@v4
35+
with:
36+
go-version: ${{ matrix.go-version }}
37+
38+
- name: Test
39+
run: go test -covermode atomic -coverprofile=covprofile ./...
40+
41+
- name: Install goveralls
42+
env:
43+
GO111MODULE: off
44+
run: go get github.com/mattn/goveralls
45+
46+
- name: Send coverage
47+
env:
48+
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
run: goveralls -coverprofile=covprofile -service=github
50+
51+
semantic-release:
52+
needs: [test]
53+
if: github.repository == 'casbin/etcd-watcher' && github.event_name == 'push'
54+
runs-on: ubuntu-latest
55+
permissions:
56+
contents: write
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@v3
60+
61+
- name: Install Node.js
62+
uses: actions/setup-node@v3
63+
with:
64+
node-version: '18.x'
65+
66+
- name: Install semantic-release
67+
run: npm install --save-dev semantic-release@21.0.0 @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github
68+
69+
- name: Run semantic-release
70+
run: npx semantic-release
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

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

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
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)
1+
Etcd Watcher
22
====
33

4+
[![Go Report Card](https://goreportcard.com/badge/github.com/casbin/etcd-watcher)](https://goreportcard.com/report/github.com/casbin/etcd-watcher)
5+
[![Go](https://github.com/casbin/etcd-watcher/actions/workflows/ci.yml/badge.svg)](https://github.com/casbin/etcd-watcher/actions/workflows/ci.yml)
6+
[![Coverage Status](https://coveralls.io/repos/github/casbin/etcd-watcher/badge.svg?branch=master)](https://coveralls.io/github/casbin/etcd-watcher?branch=master)
7+
[![Go Reference](https://pkg.go.dev/badge/github.com/casbin/etcd-watcher/v2.svg)](https://pkg.go.dev/github.com/casbin/etcd-watcher/v2)
8+
[![Release](https://img.shields.io/github/release/casbin/etcd-watcher.svg)](https://github.com/casbin/etcd-watcher/releases/latest)
9+
[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](https://discord.gg/S5UjpzGZjN)
10+
[![Sourcegraph](https://sourcegraph.com/github.com/casbin/etcd-watcher/-/badge.svg)](https://sourcegraph.com/github.com/casbin/etcd-watcher?badge)
11+
412
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.
513

614
## Installation

0 commit comments

Comments
 (0)