mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-31 20:58:43 +00:00
Add Codecov.io Upload (#660)
use https://github.com/woodpecker-ci/plugin-codecov to track code coverage on codecov.io
This commit is contained in:
parent
616c262223
commit
7b2b884a0e
4 changed files with 27 additions and 9 deletions
|
@ -52,7 +52,7 @@ pipeline:
|
|||
environment:
|
||||
- WOODPECKER_DATABASE_DRIVER=sqlite3
|
||||
commands:
|
||||
- make test-server-datastore
|
||||
- make test-server-datastore-coverage
|
||||
when:
|
||||
path:
|
||||
# related config files
|
||||
|
@ -93,6 +93,18 @@ pipeline:
|
|||
- "**/*.go"
|
||||
- "go.*"
|
||||
|
||||
codecov:
|
||||
pull: true
|
||||
image: woodpeckerci/plugin-codecov:next-alpine
|
||||
settings:
|
||||
files:
|
||||
- agent-coverage.out
|
||||
- cli-coverage.out
|
||||
- server-coverage.out
|
||||
- datastore-coverage.out
|
||||
token:
|
||||
from_secret: codecov_token
|
||||
|
||||
services:
|
||||
service-postgres:
|
||||
image: postgres:11
|
||||
|
|
11
Makefile
11
Makefile
|
@ -50,16 +50,19 @@ lint-frontend:
|
|||
(cd web/; yarn lint --quiet)
|
||||
|
||||
test-agent:
|
||||
go test -race -cover -coverprofile coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/agent github.com/woodpecker-ci/woodpecker/agent/...
|
||||
go test -race -cover -coverprofile agent-coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/agent github.com/woodpecker-ci/woodpecker/agent/...
|
||||
|
||||
test-server:
|
||||
go test -race -cover -coverprofile coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/server $(shell go list github.com/woodpecker-ci/woodpecker/server/... | grep -v '/store')
|
||||
go test -race -cover -coverprofile server-coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/server $(shell go list github.com/woodpecker-ci/woodpecker/server/... | grep -v '/store')
|
||||
|
||||
test-cli:
|
||||
go test -race -cover -coverprofile coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/cli github.com/woodpecker-ci/woodpecker/cli/...
|
||||
go test -race -cover -coverprofile cli-coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/cmd/cli github.com/woodpecker-ci/woodpecker/cli/...
|
||||
|
||||
test-server-datastore:
|
||||
go test -cover -coverprofile coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/...
|
||||
go test -race -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/...
|
||||
|
||||
test-server-datastore-coverage:
|
||||
go test -race -cover -coverprofile datastore-coverage.out -timeout 30s github.com/woodpecker-ci/woodpecker/server/store/...
|
||||
|
||||
test-frontend: frontend-dependencies
|
||||
(cd web/; yarn run lint)
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
<a href="https://ci.woodpecker-ci.org/woodpecker-ci/woodpecker" title="Build Status">
|
||||
<img src="https://ci.woodpecker-ci.org/api/badges/woodpecker-ci/woodpecker/status.svg">
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/woodpecker-ci/woodpecker">
|
||||
<img src="https://codecov.io/gh/woodpecker-ci/woodpecker/branch/master/graph/badge.svg"/>
|
||||
</a>
|
||||
<a href="https://discord.gg/fcMQqSMXJy" title="Join the Discord chat at https://discord.gg/fcMQqSMXJy">
|
||||
<img src="https://img.shields.io/discord/838698813463724034.svg?label=discord">
|
||||
</a>
|
||||
|
|
|
@ -47,7 +47,7 @@ pipeline:
|
|||
This is the reference list of all environment variables available to your pipeline containers. These are injected into your pipeline step and plugins containers, at runtime.
|
||||
|
||||
| NAME | Description |
|
||||
| ------------------------------ | -------------------------------------------------------------------------------------------- |
|
||||
|--------------------------------|----------------------------------------------------------------------------------------------|
|
||||
| `CI=woodpecker` | environment is woodpecker |
|
||||
| | **Repository** |
|
||||
| `CI_REPO` | repository full name `<owner>/<name>` |
|
||||
|
@ -63,7 +63,7 @@ This is the reference list of all environment variables available to your pipeli
|
|||
| `CI_COMMIT_SHA` | commit sha |
|
||||
| `CI_COMMIT_REF` | commit ref |
|
||||
| `CI_COMMIT_REFSPEC` | commit ref spec |
|
||||
| `CI_COMMIT_BRANCH` | commit branch |
|
||||
| `CI_COMMIT_BRANCH` | commit branch (equals target branch for pull requests) |
|
||||
| `CI_COMMIT_SOURCE_BRANCH` | commit source branch |
|
||||
| `CI_COMMIT_TARGET_BRANCH` | commit target branch |
|
||||
| `CI_COMMIT_TAG` | commit tag name (empty if event is not `tag`) |
|
||||
|
@ -110,14 +110,14 @@ This is the reference list of all environment variables available to your pipeli
|
|||
| `CI_PREV_BUILD_CREATED` | previous build created unix timestamp |
|
||||
| `CI_PREV_BUILD_STARTED` | previous build started unix timestamp |
|
||||
| `CI_PREV_BUILD_FINISHED` | previous build finished unix timestamp |
|
||||
| |   |
|
||||
| |   |
|
||||
| `CI_WORKSPACE` | Path of the workspace where source code gets cloned to |
|
||||
| | **System** |
|
||||
| `CI_SYSTEM_NAME` | name of the ci system: `woodpecker` |
|
||||
| `CI_SYSTEM_LINK` | link to ci system |
|
||||
| `CI_SYSTEM_HOST` | hostname of ci server |
|
||||
| `CI_SYSTEM_VERSION` | version of the server |
|
||||
| | **Internal** - Please don't use! |
|
||||
| | **Internal** - Please don't use! |
|
||||
| `CI_SCRIPT` | Internal script path. Used to call pipeline step commands. |
|
||||
| `CI_NETRC_USERNAME` | Credentials for private repos to be able to clone data. (Only available for specific images) |
|
||||
| `CI_NETRC_PASSWORD` | Credentials for private repos to be able to clone data. (Only available for specific images) |
|
||||
|
|
Loading…
Reference in a new issue