From fb83af072e9c9094d8ab6ec9f58a0c1e2451769f Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Wed, 11 Dec 2024 00:54:56 +0700 Subject: [PATCH] Update workflows --- .../ISSUE_TEMPLATE/bug_report.md | 0 .../feature-request---enhancement.md | 0 .../ISSUE_TEMPLATE/question.md | 0 {.github => .gitea}/PULL_REQUEST_TEMPLATE.md | 0 {.github => .gitea}/dependabot.yml | 0 {.github => .gitea}/workflows/autoapprove.yml | 0 {.github => .gitea}/workflows/automerge.yml | 0 .../workflows/codeql-analysis.yml | 0 .../workflows/dependabot-automerge.yml | 0 .gitea/workflows/job_lint.yml | 28 +++++++++++ .gitea/workflows/job_test.yml | 33 +++++++++++++ .github/workflows/build.yml | 47 ------------------- .github/workflows/pr.yml | 47 ------------------- .golangci.yml | 41 +--------------- 14 files changed, 62 insertions(+), 134 deletions(-) rename {.github => .gitea}/ISSUE_TEMPLATE/bug_report.md (100%) rename {.github => .gitea}/ISSUE_TEMPLATE/feature-request---enhancement.md (100%) rename {.github => .gitea}/ISSUE_TEMPLATE/question.md (100%) rename {.github => .gitea}/PULL_REQUEST_TEMPLATE.md (100%) rename {.github => .gitea}/dependabot.yml (100%) rename {.github => .gitea}/workflows/autoapprove.yml (100%) rename {.github => .gitea}/workflows/automerge.yml (100%) rename {.github => .gitea}/workflows/codeql-analysis.yml (100%) rename {.github => .gitea}/workflows/dependabot-automerge.yml (100%) create mode 100644 .gitea/workflows/job_lint.yml create mode 100644 .gitea/workflows/job_test.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/pr.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.gitea/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.md rename to .gitea/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/feature-request---enhancement.md b/.gitea/ISSUE_TEMPLATE/feature-request---enhancement.md similarity index 100% rename from .github/ISSUE_TEMPLATE/feature-request---enhancement.md rename to .gitea/ISSUE_TEMPLATE/feature-request---enhancement.md diff --git a/.github/ISSUE_TEMPLATE/question.md b/.gitea/ISSUE_TEMPLATE/question.md similarity index 100% rename from .github/ISSUE_TEMPLATE/question.md rename to .gitea/ISSUE_TEMPLATE/question.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.gitea/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE.md rename to .gitea/PULL_REQUEST_TEMPLATE.md diff --git a/.github/dependabot.yml b/.gitea/dependabot.yml similarity index 100% rename from .github/dependabot.yml rename to .gitea/dependabot.yml diff --git a/.github/workflows/autoapprove.yml b/.gitea/workflows/autoapprove.yml similarity index 100% rename from .github/workflows/autoapprove.yml rename to .gitea/workflows/autoapprove.yml diff --git a/.github/workflows/automerge.yml b/.gitea/workflows/automerge.yml similarity index 100% rename from .github/workflows/automerge.yml rename to .gitea/workflows/automerge.yml diff --git a/.github/workflows/codeql-analysis.yml b/.gitea/workflows/codeql-analysis.yml similarity index 100% rename from .github/workflows/codeql-analysis.yml rename to .gitea/workflows/codeql-analysis.yml diff --git a/.github/workflows/dependabot-automerge.yml b/.gitea/workflows/dependabot-automerge.yml similarity index 100% rename from .github/workflows/dependabot-automerge.yml rename to .gitea/workflows/dependabot-automerge.yml diff --git a/.gitea/workflows/job_lint.yml b/.gitea/workflows/job_lint.yml new file mode 100644 index 0000000..acfc4ed --- /dev/null +++ b/.gitea/workflows/job_lint.yml @@ -0,0 +1,28 @@ +name: lint + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - master + - v3 + - v4 + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + with: + filter: 'blob:none' + - name: setup-go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + - name: deps + run: go get -v -d ./... + - name: lint + uses: https://github.com/golangci/golangci-lint-action@v6 + with: + version: 'latest' diff --git a/.gitea/workflows/job_test.yml b/.gitea/workflows/job_test.yml new file mode 100644 index 0000000..0840a4f --- /dev/null +++ b/.gitea/workflows/job_test.yml @@ -0,0 +1,33 @@ +name: test + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - master + - v3 + - v4 + push: + branches: + - master + - v3 + - v4 + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + with: + filter: 'blob:none' + - name: setup-go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + - name: deps + run: go get -v -d ./... + - name: test + env: + INTEGRATION_TESTS: yes + run: go test -mod readonly -v ./... diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 9603352..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: build -on: - push: - branches: - - master - - v3 -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - name: setup - uses: actions/setup-go@v3 - with: - go-version: 1.17 - - name: checkout - uses: actions/checkout@v3 - - name: cache - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- - - name: deps - run: go get -v -t -d ./... - - name: test - env: - INTEGRATION_TESTS: yes - run: go test -mod readonly -v ./... - lint: - name: lint - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: lint - uses: golangci/golangci-lint-action@v3.4.0 - continue-on-error: true - 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.30 - # Optional: working directory, useful for monorepos - # working-directory: somedir - # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index f313ebe..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: prbuild -on: - pull_request: - branches: - - master - - v3 -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - name: setup - uses: actions/setup-go@v3 - with: - go-version: 1.17 - - name: checkout - uses: actions/checkout@v3 - - name: cache - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go- - - name: deps - run: go get -v -t -d ./... - - name: test - env: - INTEGRATION_TESTS: yes - run: go test -mod readonly -v ./... - lint: - name: lint - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: lint - uses: golangci/golangci-lint-action@v3.4.0 - continue-on-error: true - 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.30 - # Optional: working directory, useful for monorepos - # working-directory: somedir - # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 - # Optional: show only new issues if it's a pull request. The default value is `false`. - # only-new-issues: true diff --git a/.golangci.yml b/.golangci.yml index 6ff842d..2bb1c30 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,44 +1,5 @@ run: - concurrency: 4 + concurrency: 8 deadline: 5m issues-exit-code: 1 tests: true - -linters-settings: - govet: - check-shadowing: true - enable: - - fieldalignment - -linters: - enable: - - govet - - deadcode - - errcheck - - govet - - ineffassign - - staticcheck - - structcheck - - typecheck - - unused - - varcheck - - bodyclose - - gci - - goconst - - gocritic - - gosimple - - gofmt - - gofumpt - - goimports - - golint - - gosec - - makezero - - misspell - - nakedret - - nestif - - nilerr - - noctx - - prealloc - - unconvert - - unparam - disable-all: false