-
Notifications
You must be signed in to change notification settings - Fork 868
Expand file tree
/
Copy pathhealthchecks_openidconnectserver_ci.yml
More file actions
127 lines (120 loc) · 4.78 KB
/
Copy pathhealthchecks_openidconnectserver_ci.yml
File metadata and controls
127 lines (120 loc) · 4.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: HealthChecks OpenIdConnectServer CI
permissions:
contents: read
packages: write
on:
workflow_dispatch:
push:
branches: [ master ]
paths:
- src/HealthChecks.OpenIdConnectServer/**
- test/HealthChecks.OpenIdConnectServer.Tests/**
- test/_SHARED/**
- .github/workflows/healthchecks_openidconnectserver_ci.yml
- Directory.Build.props
- Directory.Build.targets
- Directory.Packages.props
tags:
- v*
pull_request:
branches: [ master ]
paths:
- src/HealthChecks.OpenIdConnectServer/**
- test/HealthChecks.OpenIdConnectServer.Tests/**
- test/_SHARED/**
- .github/workflows/healthchecks_openidconnectserver_ci.yml
- Directory.Build.props
- Directory.Build.targets
- Directory.Packages.props
jobs:
release-scope:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.scope.outputs.should_run }}
is_tag: ${{ steps.scope.outputs.is_tag }}
package_version: ${{ steps.scope.outputs.package_version }}
previous_tag: ${{ steps.scope.outputs.previous_tag }}
release_mode: ${{ steps.scope.outputs.release_mode }}
release_reason: ${{ steps.scope.outputs.release_reason }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Determine release scope
id: scope
shell: pwsh
run: |
./.github/scripts/get-release-scope.ps1 -ProjectPath './src/HealthChecks.OpenIdConnectServer/HealthChecks.OpenIdConnectServer.csproj'
- name: Summarize tag release scope
if: ${{ steps.scope.outputs.is_tag == 'true' }}
shell: bash
run: |
previous_tag='${{ steps.scope.outputs.previous_tag }}'
if [ -z "$previous_tag" ]; then
previous_tag='<none>'
fi
{
echo "## Project CI Tag Scope"
echo
echo "- Project: ./src/HealthChecks.OpenIdConnectServer/HealthChecks.OpenIdConnectServer.csproj"
echo "- Previous tag: $previous_tag"
echo "- Package version: ${{ steps.scope.outputs.package_version }}"
echo "- Release mode: ${{ steps.scope.outputs.release_mode }}"
echo "- Should run: ${{ steps.scope.outputs.should_run }}"
echo "- Reason: ${{ steps.scope.outputs.release_reason }}"
} >> "$GITHUB_STEP_SUMMARY"
build:
needs: release-scope
if: ${{ needs.release-scope.outputs.is_tag != 'true' || needs.release-scope.outputs.should_run == 'true' }}
runs-on: ubuntu-latest
services:
idsvr:
image: nakah/identityserver4
ports:
- 8888:80
steps:
- uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
10.0.x
- name: Restore
run: |
dotnet restore ./src/HealthChecks.OpenIdConnectServer/HealthChecks.OpenIdConnectServer.csproj &&
dotnet restore ./test/HealthChecks.OpenIdConnectServer.Tests/HealthChecks.OpenIdConnectServer.Tests.csproj
- name: Check formatting
run: |
dotnet format --no-restore --verify-no-changes --severity warn ./src/HealthChecks.OpenIdConnectServer/HealthChecks.OpenIdConnectServer.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1) &&
dotnet format --no-restore --verify-no-changes --severity warn ./test/HealthChecks.OpenIdConnectServer.Tests/HealthChecks.OpenIdConnectServer.Tests.csproj || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Build
run: |
dotnet build --no-restore ./src/HealthChecks.OpenIdConnectServer/HealthChecks.OpenIdConnectServer.csproj &&
dotnet build --no-restore ./test/HealthChecks.OpenIdConnectServer.Tests/HealthChecks.OpenIdConnectServer.Tests.csproj
- name: Test
run: >
dotnet test
./test/HealthChecks.OpenIdConnectServer.Tests/HealthChecks.OpenIdConnectServer.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@v7
with:
flags: OpenIdConnectServer
directory: .coverage
publish:
needs:
- release-scope
- build
if: ${{ needs.release-scope.outputs.is_tag == 'true' && needs.release-scope.outputs.should_run == 'true' }}
uses: ./.github/workflows/reusable_cd_workflow.yml
secrets: inherit
with:
BUILD_CONFIG: Release
PROJECT_PATH: ./src/HealthChecks.OpenIdConnectServer/HealthChecks.OpenIdConnectServer.csproj
PACKAGE_VERSION: ${{ needs.release-scope.outputs.package_version }}