Skip to content

Commit a7717eb

Browse files
authored
chore: switch travis to GitHub actions. (#14)
1 parent d110fab commit a7717eb

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

.github/workflows/go.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
go: [1.13, 1.14, 1.15, 1.16]
17+
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
18+
runs-on: ${{ matrix.os }}
19+
env:
20+
GO111MODULE: on
21+
TESTTAGS: ${{ matrix.test-tags }}
22+
GOPROXY: https://proxy.golang.org
23+
steps:
24+
- name: Set up Go ${{ matrix.go }}
25+
uses: actions/setup-go@v2
26+
with:
27+
go-version: ${{ matrix.go }}
28+
29+
- name: Checkout Code
30+
uses: actions/checkout@v2
31+
with:
32+
ref: ${{ github.ref }}
33+
34+
- name: golangci-lint
35+
uses: golangci/golangci-lint-action@v2
36+
37+
- name: Run Tests
38+
run: |
39+
go test -v -covermode=atomic -coverprofile=coverage.out
40+
41+
- name: Upload coverage to Codecov
42+
uses: codecov/codecov-action@v1

authz_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ func TestRBAC(t *testing.T) {
7878
testAuthzRequest(t, router, "cathy", "/dataset2/item", "DELETE", 403)
7979

8080
// delete all roles on user cathy, so cathy cannot access any resources now.
81-
e.DeleteRolesForUser("cathy")
81+
_, err := e.DeleteRolesForUser("cathy")
82+
if err != nil {
83+
t.Errorf("got error %v", err)
84+
}
8285

8386
testAuthzRequest(t, router, "cathy", "/dataset1/item", "GET", 403)
8487
testAuthzRequest(t, router, "cathy", "/dataset1/item", "POST", 403)

0 commit comments

Comments
 (0)