1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2026-06-03 16:35:37 +02: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:
6543
2022-02-01 19:34:56 +01:00
committed by GitHub
parent 616c262223
commit 7b2b884a0e
4 changed files with 27 additions and 9 deletions
+13 -1
View File
@@ -52,7 +52,7 @@ pipeline:
environment: environment:
- WOODPECKER_DATABASE_DRIVER=sqlite3 - WOODPECKER_DATABASE_DRIVER=sqlite3
commands: commands:
- make test-server-datastore - make test-server-datastore-coverage
when: when:
path: path:
# related config files # related config files
@@ -93,6 +93,18 @@ pipeline:
- "**/*.go" - "**/*.go"
- "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: services:
service-postgres: service-postgres:
image: postgres:11 image: postgres:11
+7 -4
View File
@@ -50,16 +50,19 @@ lint-frontend:
(cd web/; yarn lint --quiet) (cd web/; yarn lint --quiet)
test-agent: 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: 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: 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: 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 test-frontend: frontend-dependencies
(cd web/; yarn run lint) (cd web/; yarn run lint)
+3
View File
@@ -8,6 +8,9 @@
<a href="https://ci.woodpecker-ci.org/woodpecker-ci/woodpecker" title="Build Status"> <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"> <img src="https://ci.woodpecker-ci.org/api/badges/woodpecker-ci/woodpecker/status.svg">
</a> </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"> <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"> <img src="https://img.shields.io/discord/838698813463724034.svg?label=discord">
</a> </a>
+2 -2
View File
@@ -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. 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 | | NAME | Description |
| ------------------------------ | -------------------------------------------------------------------------------------------- | |--------------------------------|----------------------------------------------------------------------------------------------|
| `CI=woodpecker` | environment is woodpecker | | `CI=woodpecker` | environment is woodpecker |
| | **Repository** | | | **Repository** |
| `CI_REPO` | repository full name `<owner>/<name>` | | `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_SHA` | commit sha |
| `CI_COMMIT_REF` | commit ref | | `CI_COMMIT_REF` | commit ref |
| `CI_COMMIT_REFSPEC` | commit ref spec | | `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_SOURCE_BRANCH` | commit source branch |
| `CI_COMMIT_TARGET_BRANCH` | commit target branch | | `CI_COMMIT_TARGET_BRANCH` | commit target branch |
| `CI_COMMIT_TAG` | commit tag name (empty if event is not `tag`) | | `CI_COMMIT_TAG` | commit tag name (empty if event is not `tag`) |