Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhangjian committed Nov 30, 2024
0 parents commit 1da4432
Show file tree
Hide file tree
Showing 20 changed files with 671 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/commit_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: commit lint
on:
pull_request:
branches:
- main

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v5
22 changes: 22 additions & 0 deletions .github/workflows/go_ci_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: go ci Lint
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout 3m0s
23 changes: 23 additions & 0 deletions .github/workflows/go_imports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: go imports
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: run goimports
run: goimports -w .
- name: check for unformatted code
run: git diff --exit-code
22 changes: 22 additions & 0 deletions .github/workflows/go_mod_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: go mod check

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
go_mod_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run Go Mod Check Action
uses: shoothzj/go-mod-check-action@main
with:
prohibitIndirectDepUpdate: 'true'
26 changes: 26 additions & 0 deletions .github/workflows/go_unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: go unit test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
go_unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: setup ZooKeeper
uses: shoothzj/setup-zookeeper-action@main
- name: Run coverage
run: go test ./... -coverpkg=./... -race -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/line_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: line lint
on:
pull_request:
branches:
- main
jobs:
line_lint:
name: line lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: linelint
uses: shoothzj/linelint@main
13 changes: 13 additions & 0 deletions .github/workflows/typo_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: typo check
on:
pull_request:
branches:
- main
jobs:
typo_check:
name: typo check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check typos
uses: crate-ci/typos@master
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# file system
.DS_Store

# ide
.idea/**
.vscode/**
!.idea/icon.svg
!.idea/vcs.xml

target/*

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Go workspace file
go.work
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/asciitable.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

105 changes: 105 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1da4432

Please sign in to comment.