github.com/TugasAkhir-QUIC/quic-go@v0.0.2-0.20240215011318-d20e25a9054c/.github/workflows/lint.yml (about) 1 on: [push, pull_request] 2 3 jobs: 4 check: 5 runs-on: ubuntu-latest 6 steps: 7 - uses: actions/checkout@v4 8 - uses: actions/setup-go@v5 9 with: 10 go-version: "1.22.x" 11 - name: Check that no non-test files import Ginkgo or Gomega 12 run: .github/workflows/no_ginkgo.sh 13 - name: Check for //go:build ignore in .go files 14 run: | 15 IGNORED_FILES=$(grep -rl '//go:build ignore' . --include='*.go') || true 16 if [ -n "$IGNORED_FILES" ]; then 17 echo "::error::Found ignored Go files: $IGNORED_FILES" 18 exit 1 19 fi 20 - name: Check that go.mod is tidied 21 if: success() || failure() # run this step even if the previous one failed 22 run: | 23 cp go.mod go.mod.orig 24 cp go.sum go.sum.orig 25 go mod tidy 26 diff go.mod go.mod.orig 27 diff go.sum go.sum.orig 28 - name: Run code generators 29 if: success() || failure() # run this step even if the previous one failed 30 run: .github/workflows/go-generate.sh 31 - name: Check that go mod vendor works 32 if: success() || failure() # run this step even if the previous one failed 33 run: | 34 cd integrationtests/gomodvendor 35 go mod vendor 36 golangci-lint: 37 runs-on: ubuntu-latest 38 strategy: 39 fail-fast: false 40 matrix: 41 go: [ "1.21.x", "1.22.x" ] 42 name: golangci-lint (Go ${{ matrix.go }}) 43 steps: 44 - uses: actions/checkout@v4 45 - uses: actions/setup-go@v5 46 with: 47 go-version: ${{ matrix.go }} 48 - name: golangci-lint (Linux) 49 uses: golangci/golangci-lint-action@v3 50 with: 51 skip-pkg-cache: true 52 args: --timeout=3m 53 version: v1.55.2 54 - name: golangci-lint (Windows) 55 if: success() || failure() # run this step even if the previous one failed 56 uses: golangci/golangci-lint-action@v3 57 env: 58 GOOS: "windows" 59 with: 60 skip-pkg-cache: true 61 args: --timeout=3m 62 version: v1.55.2 63 - name: golangci-lint (OSX) 64 if: success() || failure() # run this step even if the previous one failed 65 uses: golangci/golangci-lint-action@v3 66 env: 67 GOOS: "darwin" 68 with: 69 skip-pkg-cache: true 70 args: --timeout=3m 71 version: v1.55.2 72 - name: golangci-lint (FreeBSD) 73 if: success() || failure() # run this step even if the previous one failed 74 uses: golangci/golangci-lint-action@v3 75 env: 76 GOOS: "freebsd" 77 with: 78 skip-pkg-cache: true 79 args: --timeout=3m 80 version: v1.55.2 81 - name: golangci-lint (others) 82 if: success() || failure() # run this step even if the previous one failed 83 uses: golangci/golangci-lint-action@v3 84 env: 85 GOOS: "solaris" # some OS that we don't have any build tags for 86 with: 87 skip-pkg-cache: true 88 args: --timeout=3m 89 version: v1.55.2