-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,899 additions
and
1,241 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,23 @@ | ||
pull_request_rules: | ||
- name: Test passed for code changed | ||
conditions: | ||
- or: | ||
- base=main | ||
- "status-success=Unittest AMD64 Ubuntu 18.04" | ||
- "status-success=lint" | ||
actions: | ||
label: | ||
add: | ||
- ci-passed | ||
|
||
- name: Remove ci-passed when some test failed | ||
conditions: | ||
- or: | ||
- base=main | ||
- or: | ||
- "check-failure=Unittest AMD64 Ubuntu 18.04" | ||
- "check-failure=lint" | ||
actions: | ||
label: | ||
remove: | ||
- ci-passed |
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,35 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.18 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint core | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.53.3 | ||
working-directory: ./core | ||
args: --timeout=10m --out-format=colored-line-number ./... | ||
skip-cache: true | ||
- name: golangci-lint server | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.53.3 | ||
working-directory: ./server | ||
args: --timeout=10m --out-format=colored-line-number ./... | ||
skip-cache: 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,57 @@ | ||
name: Unittest | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'core/**' | ||
- 'server/**' | ||
- 'tests/**' | ||
# Triggers the workflow on push or pull request events but only for the master branch | ||
pull_request: | ||
paths: | ||
- 'core/**' | ||
- 'server/**' | ||
- 'tests/**' | ||
|
||
|
||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
name: Unittest AMD64 Ubuntu ${{ matrix.ubuntu }} | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ubuntu: [18.04] | ||
env: | ||
UBUNTU: ${{ matrix.ubuntu }} | ||
services: | ||
mysql: | ||
image: mysql:5.7.42 | ||
env: | ||
MYSQL_ROOT_PASSWORD: 123456 | ||
MYSQL_DATABASE: milvuscdc | ||
ports: | ||
- 3306:3306 | ||
etcd: | ||
image: quay.io/coreos/etcd:v3.5.5 | ||
env: | ||
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 | ||
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379 | ||
ports: | ||
- 2379:2379 | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
# Runs a single command using the runners shell | ||
- name: Run Unittest | ||
run: make test-go | ||
- name: Upload coverage to Codecov | ||
if: github.repository == 'zilliztech/milvus-cdc' | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.project.out | ||
name: ubuntu-${{ matrix.ubuntu }}-unittests |
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,37 @@ | ||
run: | ||
skip-dirs: | ||
- pb | ||
- mocks | ||
|
||
linters-settings: | ||
golint: | ||
min-confidence: 0.8 | ||
|
||
misspell: | ||
locale: US | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- typecheck | ||
- goimports | ||
- misspell | ||
- govet | ||
- ineffassign | ||
- gosimple | ||
- revive | ||
|
||
issues: | ||
exclude-use-default: false | ||
exclude: | ||
- should have a package comment | ||
- should have comment | ||
- should be of the form | ||
- should not use dot imports | ||
- which can be annoying to use | ||
# Maximum issue count per one linter. Set to 0 to disable. Default is 50. | ||
max-issues-per-linter: 0 | ||
# Maximum count of issues with same text. Set to 0 to disable. Default is 3. | ||
max-same-issues: 0 | ||
service: | ||
golangci-lint-version: 1.50.0 # use the fixed version to not introduce new linters unexpectedly |
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
PWD := $(shell pwd) | ||
|
||
test: | ||
test-go: | ||
@echo "Running go unittests..." | ||
@(env bash $(PWD)/scripts/run_go_unittest.sh) | ||
|
||
static-check: | ||
@echo "Running go-lint check:" | ||
@(env bash $(PWD)/scripts/run_go_lint.sh) |
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,42 @@ | ||
#Configuration File for CodeCov | ||
codecov: | ||
notify: | ||
require_ci_to_pass: yes | ||
|
||
coverage: | ||
precision: 2 | ||
round: down | ||
range: "70...100" | ||
|
||
status: | ||
project: | ||
default: | ||
threshold: 0% #Allow the coverage to drop by threshold%, and posting a success status. | ||
branches: | ||
- main | ||
patch: | ||
default: | ||
target: 80% | ||
threshold: 0% | ||
branches: | ||
- main | ||
if_ci_failed: error #success, failure, error, ignore | ||
|
||
comment: | ||
layout: "reach, diff, flags, files" | ||
behavior: default | ||
require_changes: false | ||
branches: # branch names that can post comment | ||
- main | ||
|
||
ignore: | ||
- "LICENSES" | ||
- ".git" | ||
- "*.yml" | ||
- "*.md" | ||
- "docs/.*" | ||
- "**/*.pb.go" | ||
- "examples/*" | ||
- "tests/*" | ||
- "**/mocks/*" | ||
- "*_gen.go" |
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
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
Oops, something went wrong.