update *.yml

master
李光春 3 years ago
parent ad174d7356
commit a0a164b063

@ -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

@ -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
# 列出文件

2
.gitignore vendored

@ -5,5 +5,5 @@
.vscode
*.log
git.sh
gitv.sh
gittag.sh
*_test.go

@ -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."

@ -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']

@ -1,81 +1,59 @@
<img align="right" width="100" src="https://kodo-cdn.dtapp.net/04/999e9f2f06d396968eacc10ce9bc8a.png" alt="www.dtapp.net"/>
<img width="100" src="https://kodo-cdn.dtapp.net/04/999e9f2f06d396968eacc10ce9bc8a.png" alt="www.dtapp.net"/>
<h1 align="left"><a href="https://www.dtapp.net/">Golang扩展包</a></h1>
<h1><a href="https://www.dtapp.net/">Golang扩展包</a></h1>
📦 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

@ -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
Loading…
Cancel
Save