Skip to content

Commit

Permalink
chore: switch travis to GitHub actions. (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
appleboy authored Jun 20, 2021
1 parent d110fab commit a7717eb
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Run Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go: [1.13, 1.14, 1.15, 1.16]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
TESTTAGS: ${{ matrix.test-tags }}
GOPROXY: https://proxy.golang.org
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: golangci-lint
uses: golangci/golangci-lint-action@v2

- name: Run Tests
run: |
go test -v -covermode=atomic -coverprofile=coverage.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
5 changes: 4 additions & 1 deletion authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ func TestRBAC(t *testing.T) {
testAuthzRequest(t, router, "cathy", "/dataset2/item", "DELETE", 403)

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

testAuthzRequest(t, router, "cathy", "/dataset1/item", "GET", 403)
testAuthzRequest(t, router, "cathy", "/dataset1/item", "POST", 403)
Expand Down

0 comments on commit a7717eb

Please sign in to comment.