mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 07:45:30 +00:00
71 lines
1.6 KiB
YAML
71 lines
1.6 KiB
YAML
name: test
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "bind/**"
|
|
- "cmd/**"
|
|
- "internal/**"
|
|
- "pkg/**"
|
|
- "ui/**"
|
|
- ".github/workflows/test.yml"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "bind/**"
|
|
- "cmd/**"
|
|
- "internal/**"
|
|
- "pkg/**"
|
|
- "ui/**"
|
|
- ".github/workflows/test.yml"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
|
|
jobs:
|
|
# lint:
|
|
# name: Lint
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/setup-go@v2
|
|
# with:
|
|
# go-version: '^1.19'
|
|
# - 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/checkout@v3
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: "^1.19"
|
|
cache: true
|
|
- name: Run Unit tests.
|
|
run: go test $(go list ./... | grep -v /cmd/ | grep -v /bind/ ) -v -covermode=count -coverprofile=coverage.txt
|
|
- uses: codecov/codecov-action@v3
|
|
with:
|
|
files: ./coverage.txt
|
|
fail_ci_if_error: true
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
# needs: [lint, test]
|
|
needs: [test]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: "^1.19"
|
|
cache: true
|
|
- name: Build
|
|
run: go build github.com/monkeyWie/gopeed/cmd/gopeed
|