From 6b24b2ddb017b93742b6c9305208fea5eb471cfb Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 27 Jun 2023 17:39:33 +0300 Subject: [PATCH 1/2] [#98] Add forgejo workflows Signed-off-by: Alex Vanin --- .forgejo/workflows/dco.yml | 20 ++++++++++++++ .forgejo/workflows/tests.yml | 31 +++++++++++++++++++++ .github/workflows/dco.yml | 21 --------------- .github/workflows/tests.yml | 52 ------------------------------------ 4 files changed, 51 insertions(+), 73 deletions(-) create mode 100644 .forgejo/workflows/dco.yml create mode 100644 .forgejo/workflows/tests.yml delete mode 100644 .github/workflows/dco.yml delete mode 100644 .github/workflows/tests.yml diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml new file mode 100644 index 0000000..682855b --- /dev/null +++ b/.forgejo/workflows/dco.yml @@ -0,0 +1,20 @@ +on: [pull_request] + +jobs: + dco: + name: DCO + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.20' + + - name: Run commit format checker + uses: https://git.alexvan.in/alexvanin/dco-go@v1 + with: + from: 406c2324 diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml new file mode 100644 index 0000000..e457cba --- /dev/null +++ b/.forgejo/workflows/tests.yml @@ -0,0 +1,31 @@ +on: [pull_request] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: golangci-lint + uses: https://github.com/golangci/golangci-lint-action@v2 + with: + version: latest + + tests: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + go_versions: [ '1.19', '1.20' ] + fail-fast: false + steps: + - uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '${{ matrix.go_versions }}' + + - name: Run tests + run: make test diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index 40ed8fc..0000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: DCO check - -on: - pull_request: - branches: - - master - -jobs: - commits_check_job: - runs-on: ubuntu-latest - name: Commits Check - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@master - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 0b7de71..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: neofs-sdk-go tests - -on: - pull_request: - branches: - - master - types: [opened, synchronize] - paths-ignore: - - '**/*.md' - workflow_dispatch: - -jobs: - tests: - name: Tests - runs-on: ubuntu-20.04 - strategy: - matrix: - go_versions: [ '1.18.x', '1.19.x', '1.20.x' ] - fail-fast: false - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '${{ matrix.go_versions }}' - - - name: Restore Go modules from cache - uses: actions/cache@v3 - with: - path: /home/runner/go/pkg/mod - key: deps-${{ hashFiles('go.sum') }} - - - name: Update Go modules - run: make dep - - - name: Run tests - run: make test - - lint: - runs-on: ubuntu-20.04 - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest - only-new-issues: true -- 2.45.2 From deec6e0013aa8878d7d070f183fcccf3372518ac Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 27 Jun 2023 17:47:07 +0300 Subject: [PATCH 2/2] [#98] Fix linter issues Signed-off-by: Alex Vanin --- netmap/netmap.go | 1 - netmap/policy.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/netmap/netmap.go b/netmap/netmap.go index c9969b6..7da41a8 100644 --- a/netmap/netmap.go +++ b/netmap/netmap.go @@ -234,7 +234,6 @@ func (m NetMap) ContainerNodes(p PlacementPolicy, pivot []byte) ([][]NodeInfo, e } result[i] = append(result[i], flattenNodes(nodes)...) } - } return result, nil diff --git a/netmap/policy.go b/netmap/policy.go index a03d36e..06e1cba 100644 --- a/netmap/policy.go +++ b/netmap/policy.go @@ -374,6 +374,7 @@ func (p *PlacementPolicy) AddFilters(fs ...Filter) { // the result into w. Returns w's errors directly. // // See also DecodeString. +// nolint: funlen func (p PlacementPolicy) WriteStringTo(w io.StringWriter) (err error) { if p.unique { if _, err := w.WriteString("UNIQUE\n"); err != nil { -- 2.45.2