diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index babf3d31d0a1da60237d0f70d9362187ece4bfa8..11d4f074567686535829237275702801ca438853 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,16 +7,18 @@ on: branches: [ main ] jobs: - build: runs-on: ubuntu-latest + strategy: + matrix: + go: [ '1.17', '1.18' ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: '1.14.4' + go-version: ${{ matrix.go }} - name: Build run: go build -v ./... diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index f2f96ce1c1eb9cd332e03b7cf2e6d1066717ef1c..4af7bb19e9de70f3faf4fc7ec8ee938b9da4cf2f 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -9,22 +9,23 @@ on: branches: [ main ] jobs: - golangci: name: lint runs-on: ubuntu-latest + strategy: + matrix: + go: [ '1.17', '1.18' ] steps: - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: '1.14.4' - - uses: actions/checkout@v2 + go-version: ${{ matrix.go }} + - uses: actions/checkout@v3 - name: Run golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.35.0 - skip-go-installation: true + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: v1.45.2 # Optional: working directory, useful for monorepos # working-directory: somedir @@ -35,5 +36,12 @@ jobs: # Optional: show only new issues if it's a pull request. The default value is `false`. # only-new-issues: true - # Optional: if set to true then the action will use pre-installed Go - # skip-go-installation: true + # Optional: if set to true then the all caching functionality will be complete disabled, + # takes precedence over all other caching options. + # skip-cache: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true diff --git a/.golangci.yml b/.golangci.yml index d358e43d7a56f9d0597bd497bc7508c635304f6c..23246f697ed654d44322ac2f86c7e2ec9043aff2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,7 +5,7 @@ run: # default concurrency is a available CPU number concurrency: 4 # timeout for analysis, e.g. 30s, 5m, default is 1m - timeout: 1m + timeout: 3m # exit code when at least one issue was found, default is 1 issues-exit-code: 1 # include test files or not, default is true @@ -199,13 +199,15 @@ linters-settings: multi-if: false # Enforces newlines (or comments) after every multi-line if statement multi-func: false # Enforces newlines (or comments) after every multi-line function signature gci: - local-prefixes: "github.com/free5gc" + sections: + - standard + - default + - prefix(github.com/free5gc) + section-separators: + - newLine misspell: #locale: US ignore-words: - whitespace: - multi-if: false # Enforces newlines (or comments) after every multi-line if statement - multi-func: false # Enforces newlines (or comments) after every multi-line function signature wsl: # If true append is only allowed to be cuddled if appending value is # matching variables, fields or types on line above. Default is true.