Skip to content

Commit

Permalink
Add Github Actions for Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Kämmerling <[email protected]>
  • Loading branch information
LKaemmerling committed Mar 26, 2022
1 parent bea9f7f commit 0918546
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/goimports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check imports
on: [ push, pull_request ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- uses: actions/checkout@master
- name: Check imports
shell: bash
run: |
export PATH=$(go env GOPATH)/bin:$PATH
go get golang.org/x/tools/cmd/goimports
diff -u <(echo -n) <(goimports -d .)
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Run tests
on: [ push, pull_request ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.17'
- uses: actions/checkout@master
- name: Run tests
run: |
make test
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ lint:

.PHONY: test
test:
for PKG in $(PACKAGES); do go test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
for PKG in $(PACKAGES); do go test $$PKG || exit 1; done;

.PHONY: referrer-spam-blacklist
referrer-spam-blacklist:
wget https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt -O pkg/aggregator/data/blacklist.txt
go-bindata -prefix "pkg/aggregator/data/" -o pkg/aggregator/bindata.go -pkg aggregator pkg/aggregator/data/
go-bindata -prefix "pkg/aggregator/data/" -o pkg/aggregator/bindata.go -pkg aggregator pkg/aggregator/data/
2 changes: 1 addition & 1 deletion pkg/aggregator/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0918546

Please sign in to comment.