Use `go mod tidy` before make (#799)

* Use `go mod tidy` before make 

I have the issue with go 1.16 that I cannot build dapr because of a lot of errors with the message:

```
missing go.sum entry for module providing package ...
```

Maybe it's because of this issue: https://github.com/golang/go/issues/44129

Executing `go mod tidy` fixed it for me.

* Update mod tidy check equal to the one used in dapr/dapr

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
Co-authored-by: Phil Kedy <phil.kedy@gmail.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
This commit is contained in:
Christian Kaps 2021-04-27 08:08:52 +02:00 committed by GitHub
parent 509b54258e
commit b404517388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -54,9 +54,9 @@ jobs:
uses: golangci/golangci-lint-action@v2.2.1
with:
version: ${{ env.GOLANGCI_LINT_VER }}
- name: Run make go.mod check-diff
if: matrix.target_arch != 'arm'
run: make go.mod check-diff
- name: Run go mod tidy check diff
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
run: make modtidy check-diff
- name: Run make test
env:
COVERAGE_OPTS: "-coverprofile=coverage.txt -covermode=atomic"

View File

@ -64,10 +64,10 @@ lint:
$(GOLANGCI_LINT) run --timeout=20m
################################################################################
# Target: go.mod #
# Target: modtidy #
################################################################################
.PHONY: go.mod
go.mod:
.PHONY: modtidy
modtidy:
go mod tidy
################################################################################
@ -76,6 +76,7 @@ go.mod:
.PHONY: check-diff
check-diff:
git diff --exit-code ./go.mod # check no changes
git diff --exit-code ./go.sum # check no changes
################################################################################
# Target: conf-tests #

View File

@ -62,6 +62,7 @@ go mod edit -replace github.com/dapr/components-contrib=../components-contrib
4. Register your component in dapr [main.go](https://github.com/dapr/dapr/blob/d17e9243b308e830649b0bf3af5f6e84fd543baf/cmd/daprd/main.go#L153-L226)(e.g. binding)
5. Build debuggable dapr binary
```bash
go mod tidy
make DEBUG=1 build
```
6. Replace the installed daprd with the test binary (then dapr cli will use the test binary)