From 329d26116a489155ca89b59469abb6a0837ab0e3 Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Wed, 4 Dec 2024 23:40:49 +0700 Subject: [PATCH 1/5] bringing things to order in workflows and skip manual test --- .../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}/workflows/autoapprove.yml | 0 {.github => .gitea}/workflows/automerge.yml | 0 {.github => .gitea}/workflows/build.yml | 0 {.github => .gitea}/workflows/pr.yml | 0 .github/dependabot.yml | 19 ----- .github/workflows/codeql-analysis.yml | 78 ------------------- .github/workflows/dependabot-automerge.yml | 27 ------- redis_test.go | 3 +- 12 files changed, 2 insertions(+), 125 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}/workflows/autoapprove.yml (100%) rename {.github => .gitea}/workflows/automerge.yml (100%) rename {.github => .gitea}/workflows/build.yml (100%) rename {.github => .gitea}/workflows/pr.yml (100%) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/dependabot-automerge.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/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/build.yml b/.gitea/workflows/build.yml similarity index 100% rename from .github/workflows/build.yml rename to .gitea/workflows/build.yml diff --git a/.github/workflows/pr.yml b/.gitea/workflows/pr.yml similarity index 100% rename from .github/workflows/pr.yml rename to .gitea/workflows/pr.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index d5f7eae..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,19 +0,0 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates - -version: 2 -updates: - - # Maintain dependencies for GitHub Actions - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" - - # Maintain dependencies for Golang - - package-ecosystem: "gomod" - directory: "/" - schedule: - interval: "daily" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 2f6c6de..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,78 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "codeql" - -on: - workflow_run: - workflows: ["prbuild"] - types: - - completed - push: - branches: [ master, v3 ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master, v3 ] - schedule: - - cron: '34 1 * * 0' - -jobs: - analyze: - name: analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'go' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup - uses: actions/setup-go@v3 - with: - go-version: 1.17 - # Initializes the CodeQL tools for scanning. - - name: init - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: analyze - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml deleted file mode 100644 index f41c1c0..0000000 --- a/.github/workflows/dependabot-automerge.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: "dependabot-automerge" - -on: - pull_request_target: - types: [assigned, opened, synchronize, reopened] - -permissions: - pull-requests: write - contents: write - -jobs: - automerge: - runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' - steps: - - name: metadata - id: metadata - uses: dependabot/fetch-metadata@v1.3.6 - with: - github-token: "${{ secrets.TOKEN }}" - - name: merge - id: merge - if: ${{contains(steps.metadata.outputs.dependency-names, 'go.unistack.org')}} - run: gh pr merge --auto --merge "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.TOKEN}} diff --git a/redis_test.go b/redis_test.go index 3632ef9..dcb9360 100755 --- a/redis_test.go +++ b/redis_test.go @@ -14,6 +14,7 @@ import ( ) func TestLazyConnect(t *testing.T) { + t.Skip("skipping test for manual check") ctx := context.Background() var err error @@ -120,7 +121,7 @@ func Test_rkv_configure(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - b := atomic.Bool{} + b := atomic.Uint32{} rc := &Store{ opts: tt.fields.options, cli: tt.fields.Client, -- 2.45.2 From 6f6dce18bca5bac97ae1c5c1fb1aa9a42eeaca71 Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Thu, 5 Dec 2024 00:05:11 +0700 Subject: [PATCH 2/5] Update yml files for build --- .gitea/workflows/build.yml | 10 ++-------- .gitea/workflows/pr.yml | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 9603352..e33e8c3 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,17 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - name: setup - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.17 + go-version: 'stable' - 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 diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index f313ebe..323f5e8 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -10,17 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - name: setup - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.17 + go-version: 'stable' - 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 -- 2.45.2 From a7a3724319fd8a566429c56bedead3a732b3dd69 Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Thu, 5 Dec 2024 01:17:59 +0700 Subject: [PATCH 3/5] Fix pr.yml --- .gitea/workflows/pr.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 323f5e8..79d6a66 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -17,22 +17,17 @@ jobs: uses: actions/checkout@v3 - name: deps run: go get -v -t -d ./... + - 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 - 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. -- 2.45.2 From 24cd139e3ab7c1a7ef25a5c65e85c12931e2f5a4 Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Thu, 5 Dec 2024 02:19:46 +0700 Subject: [PATCH 4/5] Fix pr.yml & del build.yml --- .gitea/workflows/build.yml | 41 -------------------------------------- .gitea/workflows/pr.yml | 5 +++-- 2 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml deleted file mode 100644 index e33e8c3..0000000 --- a/.gitea/workflows/build.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: build -on: - push: - branches: - - master - - v3 -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - name: setup - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - name: checkout - uses: actions/checkout@v3 - - 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/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml index 79d6a66..c7e1230 100644 --- a/.gitea/workflows/pr.yml +++ b/.gitea/workflows/pr.yml @@ -4,6 +4,7 @@ on: branches: - master - v3 + - v4 jobs: test: name: test @@ -18,11 +19,11 @@ jobs: - name: deps run: go get -v -t -d ./... - name: lint - uses: golangci/golangci-lint-action@v3.4.0 + uses: golangci/golangci-lint-action@v6 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 + version: latest - name: test env: INTEGRATION_TESTS: yes -- 2.45.2 From 05c7e1078bc31ca7485efaa9f61874b0cc213701 Mon Sep 17 00:00:00 2001 From: Aleksandr Tolstikhin Date: Sat, 14 Dec 2024 01:49:20 +0700 Subject: [PATCH 5/5] Update workflows --- .gitea/workflows/job_lint.yml | 29 +++++++++++++++++++ .gitea/workflows/job_test.yml | 34 ++++++++++++++++++++++ .gitea/workflows/job_tests.yml | 53 ++++++++++++++++++++++++++++++++++ .gitea/workflows/pr.yml | 37 ------------------------ .golangci.yml | 5 ++++ 5 files changed, 121 insertions(+), 37 deletions(-) create mode 100644 .gitea/workflows/job_lint.yml create mode 100644 .gitea/workflows/job_test.yml create mode 100644 .gitea/workflows/job_tests.yml delete mode 100644 .gitea/workflows/pr.yml create mode 100644 .golangci.yml diff --git a/.gitea/workflows/job_lint.yml b/.gitea/workflows/job_lint.yml new file mode 100644 index 0000000..d97e747 --- /dev/null +++ b/.gitea/workflows/job_lint.yml @@ -0,0 +1,29 @@ +name: lint + +on: + pull_request: + types: [opened, reopened, synchronize] + branches: + - master + - v3 + - v4 + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: checkout code + uses: actions/checkout@v4 + with: + filter: 'blob:none' + - name: setup go + uses: actions/setup-go@v5 + with: + cache-dependency-path: "**/*.sum" + go-version: 'stable' + - name: setup deps + run: go get -v ./... + - name: run 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..f68cbca --- /dev/null +++ b/.gitea/workflows/job_test.yml @@ -0,0 +1,34 @@ +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 code + uses: actions/checkout@v4 + with: + filter: 'blob:none' + - name: setup go + uses: actions/setup-go@v5 + with: + cache-dependency-path: "**/*.sum" + go-version: 'stable' + - name: setup deps + run: go get -v ./... + - name: run test + env: + INTEGRATION_TESTS: yes + run: go test -mod readonly -v ./... diff --git a/.gitea/workflows/job_tests.yml b/.gitea/workflows/job_tests.yml new file mode 100644 index 0000000..e8984f1 --- /dev/null +++ b/.gitea/workflows/job_tests.yml @@ -0,0 +1,53 @@ +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 code + uses: actions/checkout@v4 + with: + filter: 'blob:none' + - name: checkout tests + uses: actions/checkout@v4 + with: + ref: master + filter: 'blob:none' + repository: unistack-org/micro-tests + path: micro-tests + - name: setup go + uses: actions/setup-go@v5 + with: + cache-dependency-path: "**/*.sum" + go-version: 'stable' + - name: setup go work + env: + GOWORK: /workspace/${{ github.repository_owner }}/go.work + run: | + go work init + go work use . + go work use micro-tests + - name: setup deps + env: + GOWORK: /workspace/${{ github.repository_owner }}/go.work + run: go get -v ./... + - name: run tests + env: + INTEGRATION_TESTS: yes + GOWORK: /workspace/${{ github.repository_owner }}/go.work + run: | + cd micro-tests + go test -mod readonly -v ./... || true diff --git a/.gitea/workflows/pr.yml b/.gitea/workflows/pr.yml deleted file mode 100644 index c7e1230..0000000 --- a/.gitea/workflows/pr.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: prbuild -on: - pull_request: - branches: - - master - - v3 - - v4 -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - name: setup - uses: actions/setup-go@v5 - with: - go-version: 'stable' - - name: checkout - uses: actions/checkout@v3 - - name: deps - run: go get -v -t -d ./... - - name: lint - uses: golangci/golangci-lint-action@v6 - 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: latest - - name: test - env: - INTEGRATION_TESTS: yes - run: go test -mod readonly -v ./... - - # 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 new file mode 100644 index 0000000..2bb1c30 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,5 @@ +run: + concurrency: 8 + deadline: 5m + issues-exit-code: 1 + tests: true -- 2.45.2