github.com/LagrangeDev/LagrangeGo@v0.0.0-20240512064304-ad4a85e10cb4/.github/workflows/test_and_lint.yml (about) 1 on: 2 push: 3 paths: 4 - '**.go' 5 - 'go.mod' 6 pull_request: 7 paths: 8 - '**.go' 9 - 'go.mod' 10 11 name: Test & Lint 12 13 jobs: 14 test: 15 runs-on: ubuntu-latest 16 steps: 17 - name: Code 18 uses: actions/checkout@v4 19 - name: Install Go 20 uses: actions/setup-go@v5 21 with: 22 go-version: '1.20' 23 cache: false 24 - run: go get 25 - run: go generate ./... 26 - run: go test -v -race ./... 27 28 lint: 29 runs-on: ubuntu-latest 30 steps: 31 - name: Code 32 uses: actions/checkout@v4 33 - name: Install Go 34 uses: actions/setup-go@v5 35 with: 36 cache: false 37 go-version: '1.20' 38 - run: go get 39 - run: go generate ./... 40 - name: Go vet 41 run: go vet ./... 42 43 - name: GolangCI-Lint 44 uses: golangci/golangci-lint-action@v3 45 if: github.event.name == 'pull_request' 46 with: 47 version: 'v1.55.2' 48 args: '--timeout 9999s' 49 only-new-issues: true 50 skip-pkg-cache: true 51 skip-build-cache: true 52 53 - name: GolangCI-Lint 54 uses: golangci/golangci-lint-action@v3 55 if: github.event.name != 'pull_request' 56 with: 57 version: 'v1.55.2' 58 args: '--timeout 9999s' 59 skip-pkg-cache: true 60 skip-build-cache: true