ci: support

This commit is contained in:
liwei committed 2021-03-25 19:47:59 +08:00
1 parent ede6a9834d
commit 86a1a2f981
4 files changed
+50

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
name: build
on:
pull_request:
push:
branches:
- dev
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.2'
- uses: actions/checkout@v2
- name: Lint Go Code
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
go get -u golang.org/x/lint/golint
golint -set_exit_status ./...
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.2'
- uses: actions/checkout@v2
- name: Run Unit tests.
run: go test ./... -v -covermode=count -coverprofile=coverage.txt
- uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
fail_ci_if_error: true
build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/setup-go@v2
with:
go-version: '^1.15.2'
- uses: actions/checkout@v2
- name: Build
run: go build -ldflags="-s -w" -o bin/gopeed cmd/gopeed/gopeed.go
+3
View File
@@ -1,3 +1,6 @@
[![Build Status](https://github.com/monkeyWie/gopeed-core/workflows/build/badge.svg)](https://github.com/monkeyWie/gopeed-core/actions?query=workflow%3Abuild)
[![Codecov](https://codecov.io/gh/monkeyWie/gopeed-core/branch/master/graph/badge.svg)](https://codecov.io/gh/monkeyWie/gopeed-core)
## gopeed
支持多协议(HTTP、BitTorrent)下载的客户端,提供命令行、RESTful API、WebSocket、Go 类库方式来使用。
File renamed without changes.
File renamed without changes.