trigger the CI when file with version numbers gets updated (#2330) #517
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: HealthChecks Consul CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
paths: | |
- src/HealthChecks.Consul/** | |
- test/HealthChecks.Consul.Tests/** | |
- test/_SHARED/** | |
- .github/workflows/healthchecks_consul_ci.yml | |
- Directory.Build.props | |
- Directory.Build.targets | |
- Directory.Packages.props | |
tags-ignore: | |
- release-* | |
- preview-* | |
pull_request: | |
branches: [ master ] | |
paths: | |
- src/HealthChecks.Consul/** | |
- test/HealthChecks.Consul.Tests/** | |
- test/_SHARED/** | |
- .github/workflows/healthchecks_consul_ci.yml | |
- Directory.Build.props | |
- Directory.Build.targets | |
- Directory.Packages.props | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
services: | |
consul: | |
image: hashicorp/consul:latest | |
ports: | |
- 8500:8500 | |
- 8600:8600 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
6.0.x | |
7.0.x | |
8.0.x | |
- name: Restore | |
run: | | |
dotnet restore ./src/HealthChecks.Consul/HealthChecks.Consul.csproj && | |
dotnet restore ./test/HealthChecks.Consul.Tests/HealthChecks.Consul.Tests.csproj | |
- name: Check formatting | |
run: | | |
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.Consul/HealthChecks.Consul.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) && | |
dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.Consul.Tests/HealthChecks.Consul.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) | |
- name: Build | |
run: | | |
dotnet build --no-restore ./src/HealthChecks.Consul/HealthChecks.Consul.csproj && | |
dotnet build --no-restore ./test/HealthChecks.Consul.Tests/HealthChecks.Consul.Tests.csproj | |
- name: Test | |
run: > | |
dotnet test | |
./test/HealthChecks.Consul.Tests/HealthChecks.Consul.Tests.csproj | |
--no-restore | |
--no-build | |
--collect "XPlat Code Coverage" | |
--results-directory .coverage | |
-- | |
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
- name: Upload Coverage | |
uses: codecov/codecov-action@v5 | |
with: | |
flags: Consul | |
directory: .coverage |