github.com/kubeflow/training-operator@v1.7.0/.github/workflows/test-go.yaml (about) 1 name: Go generate Test 2 3 on: 4 - push 5 - pull_request 6 7 jobs: 8 test: 9 name: Test 10 runs-on: ubuntu-latest 11 env: 12 GOPATH: ${{ github.workspace }}/go 13 defaults: 14 run: 15 working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator 16 17 steps: 18 - name: Check out code 19 uses: actions/checkout@v3 20 with: 21 path: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator 22 23 - name: Setup Go 24 uses: actions/setup-go@v3 25 with: 26 go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/training-operator/go.mod 27 28 - name: Check Go modules 29 run: | 30 go mod tidy && git add go.* && 31 git diff --cached --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit 1); 32 - name: Check manifests 33 run: | 34 make manifests && git add manifests && 35 git diff --cached --exit-code || (echo 'Please run "make manifests" to generate manifests' && exit 1); 36 - name: Check auto-generated codes 37 run: | 38 make generate && git add pkg sdk && 39 git diff --cached --exit-code || (echo 'Please run "make generate" to generate Go codes' && exit 1); 40 - name: Verify gofmt 41 run: | 42 make fmt && git add pkg cmd && 43 git diff --cached --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1); 44 - name: Verify govet 45 run: | 46 make vet && git add pkg cmd && 47 git diff --cached --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1); 48 - name: Verify golint 49 run: | 50 make golangci-lint