diff --git a/.github/workflows/goimports.yml b/.github/workflows/goimports.yml new file mode 100644 index 00000000..e7f15b94 --- /dev/null +++ b/.github/workflows/goimports.yml @@ -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 .) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..81c82c26 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/Makefile b/Makefile index 1b1696ab..51cf2c93 100644 --- a/Makefile +++ b/Makefile @@ -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/ \ No newline at end of file + go-bindata -prefix "pkg/aggregator/data/" -o pkg/aggregator/bindata.go -pkg aggregator pkg/aggregator/data/ diff --git a/pkg/aggregator/bindata.go b/pkg/aggregator/bindata.go index ceca106e..fbb2237d 100644 --- a/pkg/aggregator/bindata.go +++ b/pkg/aggregator/bindata.go @@ -182,6 +182,7 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ "blacklist.txt": &bintree{blacklistTxt, map[string]*bintree{}}, }} @@ -232,4 +233,3 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } -