From a0a164b0636943f864b367d7ec836f314cfc9764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Sat, 26 Jun 2021 11:55:34 +0800 Subject: [PATCH] update *.yml --- .codechina-ci.yml | 37 ++++++++++++++++++ .codeeui.sh | 8 ++-- .gitignore | 2 +- .gitlab-ci.yml | 29 ++++++++++++++ FUNDING.yml | 12 ++++++ README.md | 94 +++++++++++++++++---------------------------- codeql-analysis.yml | 19 +++++++++ 7 files changed, 138 insertions(+), 63 deletions(-) create mode 100644 .codechina-ci.yml create mode 100644 .gitlab-ci.yml create mode 100644 FUNDING.yml create mode 100644 codeql-analysis.yml diff --git a/.codechina-ci.yml b/.codechina-ci.yml new file mode 100644 index 00000000..25ead360 --- /dev/null +++ b/.codechina-ci.yml @@ -0,0 +1,37 @@ +# This file is a template, and might need editing before it works on your project. +image: golang:latest + +variables: + # Please edit to your GitLab project + REPO_NAME: gitlab.com/namespace/project + +# The problem is that to be able to use go get, one needs to put +# the repository in the $GOPATH. So for example if your gitlab domain +# is gitlab.com, and that your repository is namespace/project, and +# the default GOPATH being /go, then you'd need to have your +# repository in /go/src/gitlab.com/namespace/project +# Thus, making a symbolic link corrects this. +before_script: + - mkdir -p $GOPATH/src/$(dirname $REPO_NAME) + - ln -svf $CI_PROJECT_DIR $GOPATH/src/$REPO_NAME + - cd $GOPATH/src/$REPO_NAME + +stages: + - test + - build + - deploy + +format: + stage: test + script: + - go fmt $(go list ./... | grep -v /vendor/) + - go vet $(go list ./... | grep -v /vendor/) + - go test -race $(go list ./... | grep -v /vendor/) + +compile: + stage: build + script: + - go build -race -ldflags "-extldflags '-static'" -o $CI_PROJECT_DIR/mybinary + artifacts: + paths: + - mybinary diff --git a/.codeeui.sh b/.codeeui.sh index aa902175..ae373716 100644 --- a/.codeeui.sh +++ b/.codeeui.sh @@ -1,12 +1,12 @@ # 使用vendor文件夹构建 export GO15VENDOREXPERIMENT=1 -export GOPROXY=https://mirrors.aliyun.com/goproxy/ +export GOPROXY=https://goproxy.cn,direct # 在工作目录创建源文件夹 -mkdir -p $GOPATH/src/dtapps/golibrary/ +mkdir -p $GOPATH/src/dtapps/ # 拷贝代码到创建好的目录 -cp -rf . $GOPATH/src/dtapps/golibrary/ +cp -rf . $GOPATH/src/dtapps/ # 进入项目 -cd $GOPATH/src/dtapps/golibrary/ +cd $GOPATH/src/dtapps/ # 构建,在GOPATH下生成构建包 go mod tidy # 列出文件 diff --git a/.gitignore b/.gitignore index 99312ce8..a0fe1095 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ .vscode *.log git.sh -gitv.sh +gittag.sh *_test.go \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..5a0b406e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,29 @@ +--- +stages: + - ".pre" + - build + - test + - deploy + - ".post" +build-job: + stage: build + script: + - echo "Compiling the code..." + - echo "Compile complete." +unit-test-job: + stage: test + script: + - echo "Running unit tests... This will take about 60 seconds." + - sleep 60 + - echo "Code coverage is 90%" +lint-test-job: + stage: test + script: + - echo "Linting code... This will take about 10 seconds." + - sleep 10 + - echo "No lint issues found." +deploy-job: + stage: deploy + script: + - echo "Deploying application..." + - echo "Application successfully deployed." diff --git a/FUNDING.yml b/FUNDING.yml new file mode 100644 index 00000000..4b16f597 --- /dev/null +++ b/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/README.md b/README.md index 93389bb8..95ecbd1f 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,59 @@ -www.dtapp.net +www.dtapp.net -

Golang扩展包

+

Golang扩展包

📦 Golang扩展包 [comment]: <> (dtapps) -![GitHub Org's stars](https://img.shields.io/github/stars/dtapps?style=for-the-badge) +[![GitHub Org's stars](https://img.shields.io/github/stars/dtapps)](https://github.com/dtapps) [comment]: <> (go) -![golang version](https://img.shields.io/badge/golang-%3E%3D1.6-8892BF.svg?style=for-the-badge) -![godoc](https://pkg.go.dev/badge/github.com/dtapps/go-library?status.svg) +[![golang version](https://img.shields.io/badge/golang-%3E%3D1.6-8892BF.svg)](https://pkg.go.dev/github.com/dtapps/go-library) +[![godoc](https://pkg.go.dev/badge/github.com/dtapps/go-library?status.svg)](https://pkg.go.dev/github.com/dtapps/go-library) [comment]: <> (goproxy.cn) -![goproxy](https://goproxy.cn/stats/github.com/dtapps/go-library/badges/download-count.svg) +[![goproxy](https://goproxy.cn/stats/github.com/dtapps/go-library/badges/download-count.svg)](https://goproxy.cn/stats/github.com/dtapps/go-library) [comment]: <> (goreportcard.com) -![go report card](https://goreportcard.com/badge/github.com/dtapps/go-library) - -[comment]: <> (badge.fury.io) -![go project version](https://badge.fury.io/go/github.com%2Fdtapps%2Fgo-library.svg) +[![go report card](https://goreportcard.com/badge/github.com/dtapps/go-library)](https://goreportcard.com/report/github.com/dtapps/go-library) [comment]: <> (github.com) -![latest release](https://badgen.net/github/release/dtapps/go-library) -![latest stable release](https://badgen.net/github/release/dtapps/go-library/stable) -![latest tag](https://badgen.net/github/tag/dtapps/go-library) -![watchers](https://badgen.net/github/watchers/dtapps/go-library) -![combined checks (master branch)](https://badgen.net/github/checks/dtapps/go-library) -![stars](https://badgen.net/github/stars/dtapps/go-library) -![forks](https://badgen.net/github/forks/dtapps/go-library) -![issues](https://badgen.net/github/issues/dtapps/go-library) -![branches](https://badgen.net/github/branches/dtapps/go-library) -![releases](https://badgen.net/github/releases/dtapps/go-library) -![tags](https://badgen.net/github/tags/dtapps/go-library) -![license](https://badgen.net/github/license/dtapps/go-library) -![contributors](https://badgen.net/github/contributors/dtapps/go-library) -![assets downloads for latest release](https://badgen.net/github/assets-dl/dtapps/go-library) -![assets downloads for a tag](https://badgen.net/github/assets-dl/dtapps/go-library/1.0.11) -![repository dependents](https://badgen.net/github/dependents-repo/dtapps/go-library) -![package dependents](https://badgen.net/github/dependents-pkg/dtapps/go-library) -![dependabot status](https://badgen.net/github/dependabot/dtapps/go-library) -![GitHub last commit](https://img.shields.io/github/last-commit/dtapps/go-library?style=for-the-badge) -![GitHub commit activity](https://img.shields.io/github/commit-activity/w/dtapps/go-library?style=for-the-badge) -![Github All Contributors](https://img.shields.io/github/all-contributors/dtapps/go-library/master?style=for-the-badge) -![GitHub go.mod Go version (branch)](https://img.shields.io/github/go-mod/go-version/dtapps/go-version/master?style=for-the-badge) -![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/dtapps/go-library?style=for-the-badge) -![GitHub go.mod Go version (branch & subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/dtapps/go-library/master?style=for-the-badge) -![GitHub release (latest by date)](https://img.shields.io/github/v/release/dtapps/go-library?style=for-the-badge) -![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/dtapps/go-library?style=for-the-badge) -![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/dtapps/go-library?style=for-the-badge) -![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/dtapps/go-library?style=for-the-badge) -![GitHub pull requests](https://img.shields.io/github/issues-pr/dtapps/go-library?style=for-the-badge) -![GitHub issues](https://img.shields.io/github/issues/dtapps/go-library?style=for-the-badge) -![GitHub Sponsors](https://img.shields.io/github/sponsors/dtapps?style=for-the-badge) -![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dtapps/go-library?style=for-the-badge) -![GitHub language count](https://img.shields.io/github/languages/count/dtapps/go-library?style=for-the-badge) -![GitHub search hit counter](https://img.shields.io/github/search/dtapps/go-library/go?style=for-the-badge) -![GitHub top language](https://img.shields.io/github/languages/top/dtapps/go-library?style=for-the-badge) - -[comment]: <> (sourcegraph.com) -![sourcegraph](https://sourcegraph.com/github.com/dtapps/go-library/-/badge.svg) +[![watchers](https://badgen.net/github/watchers/dtapps/go-library)](https://github.com/dtapps/go-library/watchers) +[![stars](https://badgen.net/github/stars/dtapps/go-library)](https://github.com/dtapps/go-library/stargazers) +[![forks](https://badgen.net/github/forks/dtapps/go-library)](https://github.com/dtapps/go-library/network/members) +[![issues](https://badgen.net/github/issues/dtapps/go-library)](https://github.com/dtapps/go-library/issues) +[![branches](https://badgen.net/github/branches/dtapps/go-library)](https://github.com/dtapps/go-library/branches) +[![releases](https://badgen.net/github/releases/dtapps/go-library)](https://github.com/dtapps/go-library/releases) +[![tags](https://badgen.net/github/tags/dtapps/go-library)](https://github.com/dtapps/go-library/tags) +[![license](https://badgen.net/github/license/dtapps/go-library)](https://github.com/dtapps/go-library/blob/master/LICENSE) +[![contributors](https://badgen.net/github/contributors/dtapps/go-library)](https://github.com/dtapps/go-library/CONTRIBUTING.md) +[![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/dtapps/go-library)](https://github.com/dtapps/go-library) +[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/dtapps/go-library)](https://github.com/dtapps/go-library/releases) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/dtapps/go-library)](https://github.com/dtapps/go-library/tags) +[![GitHub pull requests](https://img.shields.io/github/issues-pr/dtapps/go-library)](https://github.com/dtapps/go-library/pulls) +[![GitHub issues](https://img.shields.io/github/issues/dtapps/go-library)](https://github.com/dtapps/go-library/issues) +[![GitHub Sponsors](https://img.shields.io/github/sponsors/dtapps)](https://github.com/dtapps/go-library/FUNDING.yml) +[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dtapps/go-library)](https://github.com/dtapps/go-library) +[![GitHub language count](https://img.shields.io/github/languages/count/dtapps/go-library)](https://github.com/dtapps/go-library) +[![GitHub search hit counter](https://img.shields.io/github/search/dtapps/go-library/go)](https://github.com/dtapps/go-library) +[![GitHub top language](https://img.shields.io/github/languages/top/dtapps/go-library)](https://github.com/dtapps/go-library) [comment]: <> (scrutinizer-ci.com) -![Scrutinizer build (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/build/g/dtapps/go-library/master?style=for-the-badge) -![Scrutinizer coverage (GitHub/BitBucket)](https://img.shields.io/scrutinizer/coverage/g/dtapps/go-library/master?style=for-the-badge) -![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/dtapps/go-library/master?style=for-the-badge) - -[comment]: <> (www.codetriage.com) -![open source helpers](https://www.codetriage.com/dtapps/go-library/badges/users.svg) +[![Scrutinizer build (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/build/g/dtapps/go-library/master)](https://scrutinizer-ci.com/g/dtapps/go-library) +[![Scrutinizer coverage (GitHub/BitBucket)](https://img.shields.io/scrutinizer/coverage/g/dtapps/go-library/master)](https://scrutinizer-ci.com/g/dtapps/go-library) +[![Scrutinizer code quality (GitHub/Bitbucket)](https://img.shields.io/scrutinizer/quality/g/dtapps/go-library/master)](https://scrutinizer-ci.com/g/dtapps/go-library) [comment]: <> (www.travis-ci.com) -![Travis (.com) branch](https://img.shields.io/travis/com/dtapps/go-library/master?style=for-the-badge) +[![Travis (.com) branch](https://img.shields.io/travis/com/dtapps/go-library/master)](https://www.travis-ci.com/github/dtapps/go-library) [comment]: <> (app.codecov.io) -![Codecov branch](https://img.shields.io/codecov/c/github/dtapps/go-library/master?style=for-the-badge) +[![Codecov branch](https://img.shields.io/codecov/c/github/dtapps/go-library/master)](https://app.codecov.io/gh/dtapps/go-library) + +[comment]: <> (gitlab.com) +[![gitlab (.com)](https://gitlab.com/dtapps/go-library/badges/master/pipeline.svg)](https://gitlab.com/dtapps/go-library) -[comment]: <> (twitter.com) -![Twitter Follow](https://img.shields.io/twitter/follow/GC19980202?style=for-the-badge) +[comment]: <> (codechina.csdn.net) +[![codechina.csdn (.net)](https://codechina.csdn.net/dtapps/go-library/badges/master/pipeline.svg)](https://codechina.csdn.net/dtapps/go-library) ## Install diff --git a/codeql-analysis.yml b/codeql-analysis.yml new file mode 100644 index 00000000..2375558f --- /dev/null +++ b/codeql-analysis.yml @@ -0,0 +1,19 @@ +- name: GoLang Test + # You may pin to the exact commit or the version. + # uses: n8maninger/action-golang-test@a8263fc1a85b63937b1b365946518675ceab5740 + uses: n8maninger/action-golang-test@v1 + with: + # the package to run the tests for + package: # optional, default is ./... + # additional go test command line arguments, individual arguments should be separated by ';' + args: # optional, default is + # outputs a warning for long running tests, -1 to disable + show-long-running-tests: # optional, default is 30 + # includes package output in the parsed output + show-package-output: # optional + # shows tests that were run and passed + show-passed-tests: # optional + # shows the unparsed std-out from go test instead of the parsed output + show-stdout: # optional + # skips installing and setting up Go, useful for defining additional parameters for actions/setup-go + skip-go-install: # optional \ No newline at end of file