Skip to content

Commit bc196e9

Browse files
authored
Install Codecov coverage app (#2359)
* Add Codecov step to build-cake job * Coveralls and Codecov steps must be independent and not cause job failures * Codecov step for build-cake jobs * Codecov config file * Codecov badge in README * Use shields.io as a proxy to display Coveralls badge * Line up badges
1 parent 12b9204 commit bc196e9

File tree

6 files changed

+60
-9
lines changed

6 files changed

+60
-9
lines changed

.github/steps/prepare-coveralls.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22
# Prepare Coveralls
3-
echo ------------ Listing environment variables ------------
3+
echo "::group::Listing environment variables"
44
env | sort
5+
echo "::endgroup::"
6+
57
echo ------------ Detect coverage file ------------
68
coverage_1st_folder=$(ls -d /home/runner/work/Ocelot/Ocelot/artifacts/UnitTests/*/ | head -1)
79
echo "Detected first folder : $coverage_1st_folder"

.github/workflows/develop.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,22 @@ jobs:
140140
uses: cake-build/cake-action@v3
141141
with:
142142
target: UnitTests # LatestFramework
143-
- name: Prepare Coveralls
143+
- name: Coverage files
144144
run: ./.github/steps/prepare-coveralls.sh
145145
- name: Coveralls
146146
if: env.COVERALLS_coverage_file_exists == 'true'
147147
uses: coverallsapp/github-action@v2
148148
with:
149-
fail-on-error: false
149+
# fail-on-error: false
150150
file: ${{ env.COVERALLS_coverage_file }}
151+
continue-on-error: true
152+
- name: Codecov
153+
if: env.COVERALLS_coverage_file_exists == 'true'
154+
uses: codecov/codecov-action@v5
155+
with:
156+
token: ${{ secrets.CODECOV_TOKEN }}
157+
slug: ThreeMammals/Ocelot
158+
fail_ci_if_error: true
159+
files: ${{ env.COVERALLS_coverage_file }}
160+
flags: unittests
161+
continue-on-error: true

.github/workflows/pr.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,22 @@ jobs:
169169
uses: cake-build/cake-action@v3
170170
with:
171171
target: LatestFramework
172-
- name: Prepare Coveralls
172+
- name: Coverage files
173173
run: ./.github/steps/prepare-coveralls.sh
174174
- name: Coveralls
175175
if: env.COVERALLS_coverage_file_exists == 'true'
176176
uses: coverallsapp/github-action@v2
177177
with:
178+
# fail-on-error: false
178179
file: ${{ env.COVERALLS_coverage_file }}
180+
continue-on-error: true
181+
- name: Codecov
182+
if: env.COVERALLS_coverage_file_exists == 'true'
183+
uses: codecov/codecov-action@v5
184+
with:
185+
token: ${{ secrets.CODECOV_TOKEN }}
186+
slug: ThreeMammals/Ocelot
187+
fail_ci_if_error: true
188+
files: ${{ env.COVERALLS_coverage_file }}
189+
flags: unittests
190+
continue-on-error: true

.github/workflows/release.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,22 @@ jobs:
165165
OCELOT_GITHUB_API_KEY: ${{ secrets.OCELOT_GITHUB_API_KEY }}
166166
OCELOT_NUGET_API_KEY_2025: ${{ secrets.OCELOT_NUGET_API_KEY_2025 }}
167167
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
168-
- name: Prepare Coveralls
168+
- name: Coverage files
169169
run: ./.github/steps/prepare-coveralls.sh
170170
- name: Coveralls
171171
if: env.COVERALLS_coverage_file_exists == 'true'
172172
uses: coverallsapp/github-action@v2
173173
with:
174174
file: ${{ env.COVERALLS_coverage_file }}
175175
compare-ref: main
176-
# env:
177-
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
176+
continue-on-error: true
177+
- name: Codecov
178+
if: env.COVERALLS_coverage_file_exists == 'true'
179+
uses: codecov/codecov-action@v5
180+
with:
181+
token: ${{ secrets.CODECOV_TOKEN }}
182+
slug: ThreeMammals/Ocelot
183+
fail_ci_if_error: true
184+
files: ${{ env.COVERALLS_coverage_file }}
185+
flags: unittests
186+
continue-on-error: true

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
[![Release Status](https://github.com/ThreeMammals/Ocelot/actions/workflows/release.yml/badge.svg)](https://github.com/ThreeMammals/Ocelot/actions/workflows/release.yml)
44
[![Development Status](https://github.com/ThreeMammals/Ocelot/actions/workflows/develop.yml/badge.svg)](https://github.com/ThreeMammals/Ocelot/actions/workflows/develop.yml)
55
[![ReadTheDocs](https://readthedocs.org/projects/ocelot/badge/?version=develop&style=flat-square)](https://app.readthedocs.org/projects/ocelot/builds/?version__slug=develop)
6-
[![Coveralls](https://coveralls.io/repos/github/ThreeMammals/Ocelot/badge.svg?branch=develop)](https://coveralls.io/github/ThreeMammals/Ocelot?branch=develop)
6+
[![coveralls](https://img.shields.io/coveralls/github/ThreeMammals/Ocelot/develop?label=coveralls&logo=coveralls&logoColor=white)](https://coveralls.io/github/ThreeMammals/Ocelot?branch=develop)
7+
[![codecov](https://codecov.io/gh/ThreeMammals/Ocelot/branch/develop/graph/badge.svg)](https://codecov.io/gh/ThreeMammals/Ocelot)
78
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/ThreeMammals/Ocelot/blob/main/LICENSE.md)
89
[![NuGet](https://img.shields.io/nuget/v/Ocelot?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/Ocelot/ "Download Ocelot from NuGet.org")
910
[![Downloads](https://img.shields.io/nuget/dt/Ocelot?logo=nuget&label=Downloads)](https://www.nuget.org/packages/Ocelot/ "Total Ocelot downloads from NuGet.org")
11+
<!-- [![Coveralls](https://coveralls.io/repos/github/ThreeMammals/Ocelot/badge.svg?branch=develop)](https://coveralls.io/github/ThreeMammals/Ocelot?branch=develop) -->
1012

1113
[~docspassing]: https://img.shields.io/badge/Docs-passing-44CC11?style=flat-square
1214
[~docsfailing]: https://img.shields.io/badge/Docs-failing-red?style=flat-square
@@ -30,7 +32,7 @@ There is a piece of middleware that maps the `HttpResponseMessage` onto the `Htt
3032
That is basically it, with a bunch of other features!
3133

3234
## Install
33-
Ocelot is designed to work with [ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/) and it targets `net8.0` [LTS](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#release-types) and `net9.0` [STS](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#release-types) target framework monikers ([TFMs](https://learn.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-frameworks)). [^1]
35+
Ocelot is designed to work with [ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/) and it targets `net9.0` [STS](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#release-types) and `net8.0`, `net10.0` [LTS](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core#release-types) target framework monikers ([TFMs](https://learn.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-frameworks)). [^1]
3436

3537
Install [Ocelot](https://www.nuget.org/packages/Ocelot) package and its dependencies using NuGet package manager:
3638
```powershell
@@ -114,3 +116,4 @@ If you want to contribute for the first time, we suggest looking at a [![label:
114116
[^5]: Ocelot supports the following service discovery providers: (**1**) [Consul](https://www.consul.io) through the [Ocelot.Provider.Consul](https://www.nuget.org/packages/Ocelot.Provider.Consul) extension package, (**2**) [Kubernetes](https://kubernetes.io) via the [Ocelot.Provider.Kubernetes](https://www.nuget.org/packages/Ocelot.Provider.Kubernetes) extension package, and (**3**) [Netflix Eureka](https://spring.io/projects/spring-cloud-netflix), which utilizes the [Steeltoe.Discovery.Eureka](https://www.nuget.org/packages/Steeltoe.Discovery.Eureka) package referenced within the [Ocelot.Provider.Eureka](https://www.nuget.org/packages/Ocelot.Provider.Eureka) extension package. Additionally, Ocelot supports (**4**) Azure [Service Fabric](https://azure.microsoft.com/en-us/products/service-fabric/) for service discovery, along with special modes such as [Dynamic Routing](https://ocelot.readthedocs.io/en/latest/features/servicediscovery.html#dynamic-routing) and [Custom Providers](https://ocelot.readthedocs.io/en/latest/features/servicediscovery.html#custom-providers).
115117
[^6]: Ocelot does not directly support [GraphQL](https://graphql.org/). Developers can easily integrate the [GraphQL for .NET](https://github.com/graphql-dotnet/graphql-dotnet) library.
116118
[^7]: See all [labels](https://github.com/ThreeMammals/Ocelot/issues/labels) for the repository, which are useful for searching and filtering.
119+

codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
coverage:
2+
status:
3+
project: #add everything under here, more options at https://docs.codecov.com/docs/commit-status
4+
default:
5+
target: auto
6+
threshold: 0%
7+
base: auto
8+
9+
comment:
10+
layout: "reach, diff, flags, tree"
11+
behavior: default
12+
13+
github_checks:
14+
annotations: true

0 commit comments

Comments
 (0)