Skip to content

Commit

Permalink
Merge branch 'douyu:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hjxp authored May 11, 2024
2 parents 4fb6ccf + 0c8e413 commit 197cfde
Show file tree
Hide file tree
Showing 235 changed files with 12,704 additions and 2,804 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.go text eol=lf
6 changes: 6 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ changelog:
labels:
- Semver-Minor
- enhancement
- title: Bug fixes 🐞
labels:
- bug
- title: Dependencies 👒
labels:
- dependencies
- title: Other Changes
labels:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
docs-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Run markdown linter
uses: nosborn/github-action-markdown-cli@v3.2.0
uses: nosborn/github-action-markdown-cli@v3.3.0
with:
files: website/docs,README.md,pkg
config_file: ".github/markdown_lint_config.json"
Expand All @@ -27,7 +27,7 @@ jobs:
needs: docs-lint
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# 首先生成拉取node文件
- name: Node install
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:

# 提交
- name: Deploy 🚀
uses: JamesIves/[email protected].1
uses: JamesIves/[email protected].3
with:
branch: pages
folder: ./website/docs/.vuepress/dist
15 changes: 3 additions & 12 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,18 @@ jobs:
strategy:
fail-fast: true
matrix:
go: ["1.18.x"]
go: ["1.19.x"]
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4

- name: docker-compose
run: docker-compose -f test/docker-compose.yaml up -d

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
- uses: actions/cache@v3
Expand All @@ -26,7 +26,7 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v4
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,32 @@ jobs:
strategy:
fail-fast: true
matrix:
go: ["1.18.x", "1.19.x"]
os: [ubuntu-latest, macos-latest]
go: ["1.19.x"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3.1.0
uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/[email protected]
if: runner.os != 'Windows'
uses: golangci/[email protected]
with:
version: v1.50.1
args: "--out-${NO_FUTURE}format colored-line-number"

- name: golangci-lint
if: runner.os == 'Windows'
uses: golangci/[email protected]
env:
nofuture: out-format
with:
version: v1.50.1
args: "--%nofuture% colored-line-number"
42 changes: 42 additions & 0 deletions .github/workflows/proto2http.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: proto2http

on:
push:
branches:
- "master"
pull_request:
branches:
- "master"

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
go: ["1.19.x"]

steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go

- name: do unit test
run: |
make init
make lint
make generate
make test-proto2http
make validate
4 changes: 2 additions & 2 deletions .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.7
uses: cirrus-actions/rebase@1.8
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v6
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
Expand Down
66 changes: 14 additions & 52 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,39 @@ on:
- "website/**"
branches:
- "master"
pull_request:
pull_request_target:
paths-ignore:
- "website/**"
branches:
- "master"

jobs:
lint:
name: Lint
strategy:
fail-fast: true
matrix:
go: ["1.18.x", "1.19.x"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
id: go

- name: Check out code into the Go module directory
uses: actions/[email protected]

- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Get dependencies
run: |
go env
go mod tidy && git diff --exit-code go.mod go.sum
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.50.1

test:
name: Test on ubuntu
environment:
name: tablestore-live
env:
TABLESTORE_ACCESSKEYID_ENV: ${{ secrets.TABLESTORE_ACCESSKEYID_ENV }}
TABLESTORE_ACCESSKEYSECRET_ENV: ${{ secrets.TABLESTORE_ACCESSKEYSECRET_ENV }}
TABLESTORE_ENDPOINT_ENV: ${{ secrets.TABLESTORE_ENDPOINT_ENV }}
TABLESTORE_INSTANCE_ENV: ${{ secrets.TABLESTORE_INSTANCE_ENV }}
strategy:
fail-fast: true
matrix:
go: ["1.18.x", "1.19.x"]
go: ["1.19.x"]
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/[email protected]
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: docker-compose
run: docker-compose -f test/docker-compose.yaml up -d

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go
Expand Down
58 changes: 31 additions & 27 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:
concurrency: 4
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m
timeout: 10m
# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 1
Expand All @@ -21,6 +21,7 @@ run:
# but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-dirs:
- test
# - src/external_libs
# - autogenerated_by_my_lib
# Enables skipping of directories:
Expand Down Expand Up @@ -52,35 +53,38 @@ run:
# If false (default) - golangci-lint acquires file lock on start.
allow-parallel-runners: false
linters:
disable:
enable:
- gofmt
- loggercheck
- misspell
- dupl

linters-settings:
staticcheck:
checks: ["all", "-SA1019","-SA6002"]
staticcheck:
checks: ["all", "-SA1019", "-SA6002"]
errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
# Such cases aren't reported by default.
# Default: false
# check-type-assertions: true
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
# Such cases aren't reported by default.
# Default: false
# check-type-assertions: true

# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
# Such cases aren't reported by default.
# Default: false
# check-blank: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
# Such cases aren't reported by default.
# Default: false
# check-blank: true

# DEPRECATED comma-separated list of pairs of the form pkg:regex
#
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
# ignore: Unlock|try2|UnregisterService
# DEPRECATED comma-separated list of pairs of the form pkg:regex
#
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
# ignore: Unlock|try2|UnregisterService

# DEPRECATED use exclude-functions instead.
#
# Path to a file containing a list of functions to exclude from checking.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
# exclude: /path/to/file.txt
# DEPRECATED use exclude-functions instead.
#
# Path to a file containing a list of functions to exclude from checking.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
# exclude: /path/to/file.txt

# List of functions to exclude from checking, where each entry is a single function to exclude.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
exclude-functions:


# List of functions to exclude from checking, where each entry is a single function to exclude.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
exclude-functions:
Loading

0 comments on commit 197cfde

Please sign in to comment.