From 2736c23f74f68f9b8328f07dbd6854d62e7069b7 Mon Sep 17 00:00:00 2001 From: NSMBot Date: Wed, 10 Mar 2021 12:31:30 +0000 Subject: [PATCH] Sync files with networkservicemesh/cmd-template This PR syncs files with https://github.com/networkservicemesh/cmd-template Revision: https://github.com/networkservicemesh/cmd-template/commits/f243447d4defc65d3db137add05171ce9ef38add commit f243447d4defc65d3db137add05171ce9ef38add Author: Vladimir Popov Date: Wed Mar 10 19:30:25 2021 +0700 Update CI checks (#63) * Update CI checks Signed-off-by: Vladimir Popov * Fix go generate check Signed-off-by: Vladimir Popov Signed-off-by: NSMBot --- .github/workflows/ci.yaml | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 795dafd8..fe7c1d39 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,7 +75,7 @@ jobs: - uses: actions/checkout@v2 - name: Restrict dependencies on github.com/networkservicemesh/* env: - ALLOWED_REPOSITORIES: "sdk, api, sdk-k8s, sdk-vppagent, sdk-sriov" + ALLOWED_REPOSITORIES: "sdk, api, sdk-k8s, sdk-vpp, sdk-sriov" run: | for i in $(grep github.com/networkservicemesh/ go.mod | grep -v '^module' | sed 's;.*\(github.com\/networkservicemesh\/[^ ]*\).*;\1;g');do if ! [ "$(echo ${ALLOWED_REPOSITORIES} | grep ${i#github.com/networkservicemesh/})" ]; then @@ -85,7 +85,7 @@ jobs: done checkgomod: - name: check go.mod and go.sum + name: Check go.mod and go.sum runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -93,32 +93,22 @@ jobs: with: go-version: 1.15 - run: go mod tidy - - name: Check for changes in go.mod or go.sum + - name: Check for changes run: | - git diff --name-only --exit-code go.mod || ( echo "Run go tidy" && false ) - git diff --name-only --exit-code go.sum || ( echo "Run go tidy" && false ) + git diff --name-only --exit-code || ( echo "Run go mod tidy" && false ) gogenerate: name: Check generated files runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: arduino/setup-protoc@master - with: - version: '3.8.0' - uses: actions/setup-go@v1 with: go-version: 1.15 - - name: Install proto-gen-go - run: go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.3 - - name: Install proto-gen-go - run: go get github.com/searKing/golang/tools/cmd/go-syncmap - - name: Generate files - run: go generate ./... - - name: Check for changes in generated code + - run: go generate ./... + - name: Check for changes run: | - git diff -- '*.pb.go' || ( echo "Rerun go generate ./... locally and resubmit" && false ) - git diff -- '*.gen.go' || ( echo "Rerun go generate ./... locally and resubmit" && false ) + git diff --name-only --exit-code || ( echo "Rerun go generate ./... locally and resubmit" && false ) excludereplace: name: Exclude Replace in go.mod