-
Notifications
You must be signed in to change notification settings - Fork 362
150 lines (149 loc) · 7.02 KB
/
identity-server-ci.yml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# This was generated by tool. Edits will be overwritten.
name: identity-server/ci
on:
workflow_dispatch:
push:
paths:
- .github/workflows/identity-server-**
- identity-server/**
- Directory.Packages.props
pull_request:
paths:
- .github/workflows/identity-server-**
- identity-server/**
- Directory.Packages.props
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
name: Build
if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'push')
runs-on: ubuntu-latest
permissions:
actions: read
checks: write
contents: read
packages: write
defaults:
run:
shell: bash
working-directory: identity-server
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Dotnet
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25
with:
dotnet-version: |-
6.0.x
8.0.x
9.0.x
- name: Test - Configuration.IntegrationTests
run: dotnet test -c Release test/Configuration.IntegrationTests --logger "console;verbosity=normal" --logger "trx;LogFileName=Tests.trx" --collect:"XPlat Code Coverage"
- name: Test report - Configuration.IntegrationTests
if: success() || failure()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
with:
name: Test Report - Configuration.IntegrationTests
path: identity-server/test/Configuration.IntegrationTests/TestResults/Tests.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
- name: Test - EntityFramework.IntegrationTests
run: dotnet test -c Release test/EntityFramework.IntegrationTests --logger "console;verbosity=normal" --logger "trx;LogFileName=Tests.trx" --collect:"XPlat Code Coverage"
- name: Test report - EntityFramework.IntegrationTests
if: success() || failure()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
with:
name: Test Report - EntityFramework.IntegrationTests
path: identity-server/test/EntityFramework.IntegrationTests/TestResults/Tests.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
- name: Test - EntityFramework.Storage.IntegrationTests
run: dotnet test -c Release test/EntityFramework.Storage.IntegrationTests --logger "console;verbosity=normal" --logger "trx;LogFileName=Tests.trx" --collect:"XPlat Code Coverage"
- name: Test report - EntityFramework.Storage.IntegrationTests
if: success() || failure()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
with:
name: Test Report - EntityFramework.Storage.IntegrationTests
path: identity-server/test/EntityFramework.Storage.IntegrationTests/TestResults/Tests.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
- name: Test - EntityFramework.Storage.UnitTests
run: dotnet test -c Release test/EntityFramework.Storage.UnitTests --logger "console;verbosity=normal" --logger "trx;LogFileName=Tests.trx" --collect:"XPlat Code Coverage"
- name: Test report - EntityFramework.Storage.UnitTests
if: success() || failure()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
with:
name: Test Report - EntityFramework.Storage.UnitTests
path: identity-server/test/EntityFramework.Storage.UnitTests/TestResults/Tests.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
- name: Test - IdentityServer.IntegrationTests
run: dotnet test -c Release test/IdentityServer.IntegrationTests --logger "console;verbosity=normal" --logger "trx;LogFileName=Tests.trx" --collect:"XPlat Code Coverage"
- name: Test report - IdentityServer.IntegrationTests
if: success() || failure()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
with:
name: Test Report - IdentityServer.IntegrationTests
path: identity-server/test/IdentityServer.IntegrationTests/TestResults/Tests.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
- name: Test - IdentityServer.UnitTests
run: dotnet test -c Release test/IdentityServer.UnitTests --logger "console;verbosity=normal" --logger "trx;LogFileName=Tests.trx" --collect:"XPlat Code Coverage"
- name: Test report - IdentityServer.UnitTests
if: success() || failure()
uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5
with:
name: Test Report - IdentityServer.UnitTests
path: identity-server/test/IdentityServer.UnitTests/TestResults/Tests.trx
reporter: dotnet-trx
fail-on-error: true
fail-on-empty: true
- name: Tool restore
run: dotnet tool restore
- name: Pack AspNetIdentity
run: dotnet pack -c Release src/AspNetIdentity -o artifacts
- name: Pack Configuration
run: dotnet pack -c Release src/Configuration -o artifacts
- name: Pack Configuration.EntityFramework
run: dotnet pack -c Release src/Configuration.EntityFramework -o artifacts
- name: Pack EntityFramework
run: dotnet pack -c Release src/EntityFramework -o artifacts
- name: Pack EntityFramework.Storage
run: dotnet pack -c Release src/EntityFramework.Storage -o artifacts
- name: Pack IdentityServer
run: dotnet pack -c Release src/IdentityServer -o artifacts
- name: Pack Storage
run: dotnet pack -c Release src/Storage -o artifacts
- name: Sign packages
if: github.event == 'push'
run: |-
for file in artifacts/*.nupkg; do
dotnet NuGetKeyVaultSignTool sign "$file" --file-digest sha256 --timestamp-rfc3161 http://timestamp.digicert.com --azure-key-vault-url https://duendecodesigninghsm.vault.azure.net/ --azure-key-vault-client-id 18e3de68-2556-4345-8076-a46fad79e474 --azure-key-vault-tenant-id ed3089f0-5401-4758-90eb-066124e2d907 --azure-key-vault-client-secret ${{ secrets.SignClientSecret }} --azure-key-vault-certificate NuGetPackageSigning
done
- name: Push packages to MyGet
if: github.ref == 'refs/heads/main'
run: dotnet nuget push artifacts/*.nupkg --source https://www.myget.org/F/duende_identityserver/api/v2/package --api-key ${{ secrets.MYGET }} --skip-duplicate
- name: Push packages to GitHub
if: github.ref == 'refs/heads/main'
run: dotnet nuget push artifacts/*.nupkg --source https://nuget.pkg.github.com/DuendeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifacts
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: artifacts
path: identity-server/artifacts/*.nupkg
overwrite: true
retention-days: 15