when:
- event: ["push", "pull_request"]
branch: master
engine: microvm
image: nixos
dependencies:
- go
- gcc
environment:
CGO_ENABLED: 1
GOCACHE: /workspace/repo/.cache/go-build
GOMODCACHE: /workspace/repo/.cache/go-mod
cache:
- key: go
hash:
- go.sum
fallback: true
when: always
paths:
- .cache/go-build
- .cache/go-mod
steps:
- name: run linter
command: |
go vet -v ./...
- name: run all tests
command: |
set -e
ffi=$(nix build .#hydrant-ffi --no-link --print-out-paths)
export CGO_LDFLAGS="-L$ffi/lib"
# the sqlite tests fsync a lot, and fsync on the vm disk is slow
# spindle's tests mostly wait on fake services, so more of them can run at once than there are cores
GOTMPDIR=/tmp TMPDIR=/dev/shm go test -v -parallel 8 ./...
go build -o /tmp/bin/ ./cmd/spindle ./cmd/migrator