mirror of https://github.com/etcd-io/bbolt.git
Merge pull request #321 from mrueg/github-actions
Move to Github Actions / Golangci-Lintpull/342/head
commit
00cd6970d0
|
@ -0,0 +1,16 @@
|
||||||
|
name: Tests
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: "1.17.8"
|
||||||
|
- run: make fmt
|
||||||
|
- run: make race
|
||||||
|
- run: make test
|
||||||
|
# Enable when fixed (same as make lint)
|
||||||
|
# - name: golangci-lint
|
||||||
|
# uses: golangci/golangci-lint-action@v2
|
18
.travis.yml
18
.travis.yml
|
@ -1,18 +0,0 @@
|
||||||
language: go
|
|
||||||
go_import_path: go.etcd.io/bbolt
|
|
||||||
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
go:
|
|
||||||
- 1.15
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- go get -v golang.org/x/sys/unix
|
|
||||||
- go get -v honnef.co/go/tools/...
|
|
||||||
- go get -v github.com/kisielk/errcheck
|
|
||||||
|
|
||||||
script:
|
|
||||||
- make fmt
|
|
||||||
- make test
|
|
||||||
- make race
|
|
||||||
# - make errcheck
|
|
15
Makefile
15
Makefile
|
@ -10,17 +10,8 @@ race:
|
||||||
fmt:
|
fmt:
|
||||||
!(gofmt -l -s -d $(shell find . -name \*.go) | grep '[a-z]')
|
!(gofmt -l -s -d $(shell find . -name \*.go) | grep '[a-z]')
|
||||||
|
|
||||||
# go get honnef.co/go/tools/simple
|
lint:
|
||||||
gosimple:
|
golangci-lint run ./...
|
||||||
gosimple ./...
|
|
||||||
|
|
||||||
# go get honnef.co/go/tools/unused
|
|
||||||
unused:
|
|
||||||
unused ./...
|
|
||||||
|
|
||||||
# go get github.com/kisielk/errcheck
|
|
||||||
errcheck:
|
|
||||||
@errcheck -ignorepkg=bytes -ignore=os:Remove go.etcd.io/bbolt
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
TEST_FREELIST_TYPE=hashmap go test -timeout 20m -v -coverprofile cover.out -covermode atomic
|
TEST_FREELIST_TYPE=hashmap go test -timeout 20m -v -coverprofile cover.out -covermode atomic
|
||||||
|
@ -33,4 +24,4 @@ test:
|
||||||
# Note: gets "program not an importable package" in out of path builds
|
# Note: gets "program not an importable package" in out of path builds
|
||||||
@TEST_FREELIST_TYPE=array go test -v ./cmd/bbolt
|
@TEST_FREELIST_TYPE=array go test -v ./cmd/bbolt
|
||||||
|
|
||||||
.PHONY: race fmt errcheck test gosimple unused
|
.PHONY: race fmt test lint
|
||||||
|
|
|
@ -30,7 +30,7 @@ const pageHeaderSize = 16
|
||||||
|
|
||||||
// meta represents a simplified version of a database meta page for testing.
|
// meta represents a simplified version of a database meta page for testing.
|
||||||
type meta struct {
|
type meta struct {
|
||||||
magic uint32
|
_ uint32
|
||||||
version uint32
|
version uint32
|
||||||
_ uint32
|
_ uint32
|
||||||
_ uint32
|
_ uint32
|
||||||
|
@ -38,7 +38,7 @@ type meta struct {
|
||||||
_ uint64
|
_ uint64
|
||||||
pgid uint64
|
pgid uint64
|
||||||
_ uint64
|
_ uint64
|
||||||
checksum uint64
|
_ uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure that a database can be opened without error.
|
// Ensure that a database can be opened without error.
|
||||||
|
|
Loading…
Reference in New Issue