-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: liubo02 <[email protected]> Co-authored-by: Hoshea <[email protected]>
- Loading branch information
Showing
315 changed files
with
57,966 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_output | ||
manifests | ||
examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
header: | ||
license: | ||
spdx-id: Apache-2.0 | ||
copyright-owner: PingCAP, Inc. | ||
copyright-year: '2024' | ||
paths-ignore: | ||
- "**/.git/**" | ||
- ".github/" | ||
- "_output/**" | ||
- "examples/**" | ||
- "image/**" | ||
- "manifests/**" | ||
- ".gitignore" | ||
- ".dockerignore" | ||
- ".golangci.yml" | ||
- "LICENSES/" | ||
- "**/*.md" | ||
- ".codecov.yml" | ||
- "**/go.mod" | ||
- "**/go.sum" | ||
- "**/go.work" | ||
- "**/go.work.sum" | ||
- "**/LICENSE" | ||
- "third_party/**" | ||
- "pkg/**/*mock.go" | ||
|
||
|
||
comment: on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
types: [review_requested, ready_for_review, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
image: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: cache image builder | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./_output/cache | ||
key: ${{ runner.os }}-image-cache | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- uses: docker/setup-qemu-action@v3 | ||
with: | ||
image: gcr.io/pingcap-public/third-party/tonistiigi/binfmt:latest | ||
|
||
- name: setup buildx context | ||
run: | | ||
docker context create builder | ||
- uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/arm64,linux/amd64 | ||
endpoint: builder | ||
driver-opts: | | ||
image=gcr.io/pingcap-public/third-party/moby/buildkit:buildx-stable-1 | ||
- name: image | ||
run: | | ||
V_PLATFORMS=linux/arm64,linux/amd64 make image | ||
build: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.work | ||
cache-dependency-path: "**/*.sum" | ||
- name: build | ||
run: | | ||
make build | ||
lint: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.work | ||
cache-dependency-path: "**/*.sum" | ||
- name: cache golangci-lint | ||
uses: actions/cache@v4 | ||
with: | ||
path: ./_output/bin/golangci-lint | ||
key: ${{ runner.os }}-golangci-lint | ||
- name: lint | ||
run: | | ||
make lint | ||
unit: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.work | ||
cache-dependency-path: "**/*.sum" | ||
- name: unit test | ||
run: | | ||
make unit | ||
verify: | ||
runs-on: self-hosted | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.work | ||
cache-dependency-path: "**/*.sum" | ||
- name: verify | ||
run: | | ||
make verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: e2e | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: [review_requested, ready_for_review, synchronize] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
e2e: | ||
runs-on: self-hosted | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
spec: | ||
- "Basic" | ||
- "Rolling Update" | ||
- "Version Upgrade" | ||
- "TLS" | ||
- "TiDB Feature" | ||
- "Overlay" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./go.work | ||
cache-dependency-path: "**/*.sum" | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- uses: docker/setup-qemu-action@v3 | ||
with: | ||
image: gcr.io/pingcap-public/third-party/tonistiigi/binfmt:latest | ||
|
||
- name: setup buildx context | ||
run: | | ||
docker context create builder | ||
- uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/arm64,linux/amd64 | ||
endpoint: builder | ||
driver-opts: | | ||
image=gcr.io/pingcap-public/third-party/moby/buildkit:buildx-stable-1 | ||
- name: E2E test | ||
env: | ||
CI: "true" | ||
GINKGO_OPTS: "--focus=${{ matrix.spec }}" | ||
run: | | ||
make e2e/prepare | ||
make e2e/run | ||
- name: Collect logs of Operator | ||
if: always() | ||
run: | | ||
./_output/bin/kubectl logs -n tidb-admin deployment/tidb-operator > tidb-operator.log | ||
- name: Upload logs | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
retention-days: 7 | ||
name: tidb-operator-log-${{ github.run_id }}-${{ github.job }} | ||
path: tidb-operator.log | ||
overwrite: 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
_output | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
linters-settings: | ||
dupl: | ||
threshold: 100 | ||
funlen: | ||
lines: -1 | ||
statements: 50 | ||
goconst: | ||
min-len: 2 | ||
min-occurrences: 3 | ||
gocritic: | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
disabled-checks: | ||
- dupImport # https://github.com/go-critic/go-critic/issues/845 | ||
- ifElseChain | ||
- octalLiteral | ||
- whyNoLint | ||
gocyclo: | ||
min-complexity: 15 | ||
godox: | ||
keywords: | ||
- FIXME | ||
gofmt: | ||
rewrite-rules: | ||
- pattern: 'interface{}' | ||
replacement: 'any' | ||
goimports: | ||
local-prefixes: github.com/pingcap/tidb-operator | ||
mnd: | ||
# don't include the "operation" and "assign" | ||
checks: | ||
- argument | ||
- case | ||
- condition | ||
- return | ||
ignored-numbers: | ||
- '0' | ||
- '1' | ||
- '2' | ||
- '3' | ||
ignored-functions: | ||
- strings.SplitN | ||
govet: | ||
enable: | ||
- nilness | ||
- shadow | ||
errorlint: | ||
asserts: false | ||
lll: | ||
line-length: 140 | ||
misspell: | ||
locale: US | ||
ignore-words: | ||
- "importas" # linter name | ||
nolintlint: | ||
allow-unused: false # report any unused nolint directives | ||
require-explanation: true # require an explanation for nolint directives | ||
require-specific: true # require nolint directives to be specific about which linter is being skipped | ||
revive: | ||
rules: | ||
- name: indent-error-flow | ||
- name: unexported-return | ||
disabled: true | ||
- name: unused-parameter | ||
- name: unused-receiver | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- dogsled | ||
- errcheck | ||
- errorlint | ||
- copyloopvar | ||
- gocheckcompilerdirectives | ||
- goconst | ||
# - gochecknoinits | ||
- gocritic | ||
- gocyclo | ||
- godox | ||
- gofmt | ||
- goimports | ||
- mnd | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- lll | ||
- misspell | ||
- nakedret | ||
- noctx | ||
- nolintlint | ||
- revive | ||
- stylecheck | ||
- staticcheck | ||
- testifylint | ||
- unconvert | ||
- unparam | ||
- unused | ||
- whitespace | ||
|
||
# This list of linters is not a recommendation (same thing for all this configuration file). | ||
# We intentionally use a limited set of linters. | ||
# See the comment on top of this file. | ||
|
||
issues: | ||
exclude-rules: | ||
- path: (.+)_test\.go | ||
linters: | ||
- dupl | ||
- mnd | ||
- lll | ||
|
||
run: | ||
timeout: 15m |
Oops, something went wrong.