name: "go: build binary" on: push: branches: [ master ] pull_request: branches: [ master ] concurrency: group: ${{ github.head_ref }}/go cancel-in-progress: true permissions: contents: read jobs: build: name: Build runs-on: ubuntu-latest steps: - name: Set up Go 1.x uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v2 with: go-version: ^1.13 id: go - name: Check out code into the Go module directory uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v2 - name: Get dependencies run: | cd weed; go get -v -t -d ./... - name: Go Vet (excluding protobuf lock copying) run: | cd weed # Run go vet and filter out known protobuf MessageState lock copying warnings # These are expected in generated protobuf code with embedded sync.Mutex and are safe in practice go vet -v ./... 2>&1 | grep -v "MessageState contains sync.Mutex" | grep -v "IdentityAccessManagement contains sync.RWMutex" | tee vet-output.txt # Fail only if there are actual vet errors (not counting the filtered lock warnings) if grep -q "vet:" vet-output.txt; then exit 1; fi - name: Build run: cd weed; go build -tags "elastic gocdk sqlite ydb tarantool tikv rclone" -v . - name: Test run: cd weed; go test -tags "elastic gocdk sqlite ydb tarantool tikv rclone" -v ./...