-
Notifications
You must be signed in to change notification settings - Fork 64
784 lines (670 loc) · 32 KB
/
all_solutions.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
name: .NET Agent All Solutions Build
# Does not run on PUSH since we have already ran all the test
on:
pull_request:
branches:
- main
- "feature/**"
release:
types: [published]
workflow_dispatch:
schedule:
- cron: "0 9 * * *"
# only allow one instance of this workflow to be running per PR or branch, cancels any that are already running
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
scripts_path: ${{ github.workspace }}\build\scripts
tools_path: ${{ github.workspace }}\build\Tools
DOTNET_NOLOGO: true
jobs:
# This builds both FullAgent and MSIInstaller since MSIInstaller requires FullAgent artifacts.
build-fullagent-msi:
name: Build FullAgent and MSIInstaller
runs-on: windows-2022
env:
fullagent_solution_path: ${{ github.workspace }}\FullAgent.sln
msi_solution_path: ${{ github.workspace }}\src\Agent\MsiInstaller\MsiInstaller.sln
outputs:
agentVersion: ${{ steps.agentVersion.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
- name: Build FullAgent.sln
run: |
Write-Host "List NuGet Sources"
dotnet nuget list source # For unknown reasons, this step is necessary to avoid subsequent problems with NuGet package restore
Write-Host "MSBuild.exe -restore -m -p:Configuration=Release -p:AllowUnsafeBlocks=true ${{ env.fullagent_solution_path }}"
MSBuild.exe -restore -m -p:Configuration=Release -p:AllowUnsafeBlocks=true ${{ env.fullagent_solution_path }}
shell: powershell
- name: Create agentVersion
id: agentVersion
run: |
$agentVersion = (Get-Item "${{ github.workspace }}\src\_build\AnyCPU-Release\NewRelic.Agent.Core\net462\NewRelic.Agent.Core.dll").VersionInfo.FileVersion
echo "version=$agentVersion" >> $env:GITHUB_OUTPUT
shell: powershell
- name: Archive NewRelic.NuGetHelper
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: NewRelic.NuGetHelper
path: ${{ github.workspace }}\build\NewRelic.NuGetHelper\bin
if-no-files-found: error
- name: Archive NewRelic.Agent.Extensions
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: NewRelic.Agent.Extensions
path: ${{ github.workspace }}\src\Agent\NewRelic\Agent\Extensions\NewRelic.Agent.Extensions\bin\Release
if-no-files-found: error
- name: Archive FullAgent Home folders
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: homefolders
path: |
${{ github.workspace }}\src\Agent\newrelichome_x64
${{ github.workspace }}\src\Agent\newrelichome_x64_coreclr
${{ github.workspace }}\src\Agent\newrelichome_x64_coreclr_linux
${{ github.workspace }}\src\Agent\newrelichome_arm64_coreclr_linux
${{ github.workspace }}\src\Agent\newrelichome_x86
${{ github.workspace }}\src\Agent\newrelichome_x86_coreclr
if-no-files-found: error
- name: Convert Code Signing Certificate Into File
if: ${{ github.event.release }} || github.event_name == 'workflow_dispatch'
id: write_cert
run: |
$filePath = '${{ github.workspace }}\newrelic_code_sign_cert.pfx'
$bytes = [Convert]::FromBase64String('${{ secrets.SIGNING_CERT }}')
[IO.File]::WriteAllBytes($filePath, $bytes)
echo "filePath=$filePath" >> $env:GITHUB_OUTPUT
shell: powershell
- name: Install Code Signing Certificate
if: ${{ github.event.release }} || github.event_name == 'workflow_dispatch'
run: |
Write-Host "certutil.exe -f -user -p <passphrase> -importPFX ${{ steps.write_cert.outputs.filePath }} NoRoot"
certutil.exe -f -user -p ${{ secrets.CERT_PASSPHRASE }} -importPFX ${{ steps.write_cert.outputs.filePath }} NoRoot
shell: powershell
- name: Create Self-signed code signing cert
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
run: |
Write-Host "New-SelfSignedCertificate -DnsName "Self-signed code signing cert" -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My -NotAfter (Get-Date).AddYears(100)"
New-SelfSignedCertificate -DnsName "Self-signed code signing cert" -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My -NotAfter (Get-Date).AddYears(100)
shell: powershell
- name: Build MsiInstaller.sln x86
run: |
Write-Host "MSBuild.exe -restore -m -p:Configuration=Release -p:AllowUnsafeBlocks=true -p:Platform=x86 ${{ env.msi_solution_path }}"
MSBuild.exe -restore -m -p:Configuration=Release -p:AllowUnsafeBlocks=true -p:Platform=x86 ${{ env.msi_solution_path }}
shell: powershell
- name: Build MsiInstaller.sln x64
run: |
Write-Host "MSBuild.exe -restore -m -p:Configuration=Release -p:AllowUnsafeBlocks=true -p:Platform=x64 ${{ env.msi_solution_path }}"
MSBuild.exe -restore -m -p:Configuration=Release -p:AllowUnsafeBlocks=true -p:Platform=x64 ${{ env.msi_solution_path }}
shell: powershell
- name: Archive msi _build Artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: msi-build-folder-artifacts
path: ${{ github.workspace }}\src\_build
if-no-files-found: error
- name: Archive NewRelic.OpenTracing.AmazonLambda.Tracer
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: NewRelic.OpenTracing.AmazonLambda.Tracer
path: ${{ github.workspace }}\src\AwsLambda\AwsLambdaOpenTracer\bin\Release\netstandard2.0-ILRepacked
if-no-files-found: error
build-integration-tests:
needs: build-fullagent-msi
name: Build IntegrationTests
runs-on: windows-2022
env:
integration_solution_path: ${{ github.workspace }}\tests\Agent\IntegrationTests\IntegrationTests.sln
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
with:
vs-prerelease: true
- name: List SDKS
run: dotnet --list-sdks
shell: powershell
- name: Build IntegrationTests.sln
run: |
Write-Host "List NuGet Sources"
dotnet nuget list source # For unknown reasons, this step is necessary to avoid subsequent problems with NuGet package restore
Write-Host "MSBuild.exe -restore -m -p:Configuration=Release -p:DeployOnBuild=true -p:PublishProfile=LocalDeploy ${{ env.integration_solution_path }}"
MSBuild.exe -restore -m -p:Configuration=Release -p:DeployOnBuild=true -p:PublishProfile=LocalDeploy ${{ env.integration_solution_path }}
shell: powershell
- name: Archive Artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: integrationtests
path: |
${{ github.workspace }}\test.runsettings # Force the artifacts to use repo root as root of package.
${{ github.workspace }}\tests\Agent\IntegrationTests\**\bin\**\*
${{ github.workspace }}\tests\Agent\IntegrationTests\**\Deploy\**\*
!${{ github.workspace }}\tests\Agent\IntegrationTests\**\obj\**\*
if-no-files-found: error
build-unbounded-tests:
needs: build-fullagent-msi
name: Build UnboundedIntegrationTests
runs-on: windows-2022
env:
unbounded_solution_path: ${{ github.workspace }}\tests\Agent\IntegrationTests\UnboundedIntegrationTests.sln
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c # v1.3.1
with:
vs-prerelease: true
- name: Build UnboundedIntegrationTests.sln
run: |
Write-Host "List NuGet Sources"
dotnet nuget list source # For unknown reasons, this step is necessary to avoid subsequent problems with NuGet package restore
Write-Host "MSBuild.exe -restore -m -p:Configuration=Release -p:DeployOnBuild=true -p:PublishProfile=LocalDeploy ${{ env.unbounded_solution_path }}"
MSBuild.exe -restore -m -p:Configuration=Release -p:DeployOnBuild=true -p:PublishProfile=LocalDeploy ${{ env.unbounded_solution_path }}
shell: powershell
- name: Archive Artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: unboundedintegrationtests
path: |
${{ github.workspace }}\test.runsettings # Force the artifacts to use repo root as root of package.
${{ github.workspace }}\tests\Agent\IntegrationTests\**\bin\**\*
${{ github.workspace }}\tests\Agent\IntegrationTests\**\Deploy\**\*
!${{ github.workspace }}\tests\Agent\IntegrationTests\**\obj\**\*
if-no-files-found: error
run-integration-tests:
needs: [build-integration-tests]
name: Run IntegrationTests
runs-on: windows-2022
strategy:
matrix:
namespace: [
AgentFeatures,
AgentLogs,
AgentMetrics,
Api,
AppDomainCaching,
AspNetCore,
BasicInstrumentation,
CatInbound,
CatOutbound,
CodeLevelMetrics,
Configuration,
CSP,
CustomAttributes,
CustomInstrumentation,
DataTransmission,
DistributedTracing,
Errors,
HttpClientInstrumentation,
InfiniteTracing,
Logging.ContextData,
Logging.HsmAndCsp,
Logging.LocalDecoration,
Logging.LogLevelDetection,
Logging.MaxSamplesStored,
Logging.MetricsAndForwarding,
Logging.ZeroMaxSamplesStored,
Owin,
ReJit.NetCore,
ReJit.NetFramework,
RequestHandling,
RequestHeadersCapture.AspNet,
RequestHeadersCapture.AspNetCore,
RequestHeadersCapture.EnvironmentVariables,
RequestHeadersCapture.Owin,
RequestHeadersCapture.WCF,
RestSharp,
WCF.Client.IIS.ASPDisabled,
WCF.Client.IIS.ASPEnabled,
WCF.Client.Self,
WCF.Service.IIS.ASPDisabled,
WCF.Service.IIS.ASPEnabled,
WCF.Service.Self] # maintain alphabetical order, please!
fail-fast: false # we don't want one test failure in one namespace to kill the other runs
env:
integration_tests_shared_project: ${{ github.workspace }}/tests/Agent/IntegrationTests/Shared
integration_tests_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/IntegrationTests/bin/Release/net462
# Make this variable true to enable extra data-gathering and logging to help troubleshoot test failures, at the cost of additional time and resources
enhanced_logging: false
NR_DOTNET_TEST_SAVE_WORKING_DIRECTORY: 1
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Disable TLS 1.3
run: |
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client"
if(!(Test-Path $registryPath)) {
New-Item -Path $registryPath -Force
}
New-ItemProperty -Path $registryPath -Name "DisabledByDefault" -Value "1" -PropertyType DWORD -Force
New-ItemProperty -Path $registryPath -Name "Enabled" -Value "0" -PropertyType DWORD -Force
shell: powershell
- name: Create and trust .NET development SSL certificate
run: |
dotnet dev-certs https --clean
dotnet dev-certs https --export-path ./devcert.pfx --password "password1"
$pwd = ConvertTo-SecureString -String "password1" -Force -AsPlainText
Import-PfxCertificate -FilePath ./devcert.pfx -CertStoreLocation Cert:\LocalMachine\Root -Password $pwd
dotnet dev-certs https --check --trust
shell: powershell
- name: Set up secrets
env:
INTEGRATION_TEST_SECRETS: ${{ secrets.TEST_SECRETS }}
run: |
"$Env:INTEGRATION_TEST_SECRETS" | dotnet user-secrets set --project ${{ env.integration_tests_shared_project }}
shell: pwsh #this doesn't work with normal powershell due to UTF-8 BOM handling
- name: Download Agent Home Folders
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: homefolders
path: src/Agent
- name: Download Integration Test Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: integrationtests
# Should not need a path because the integration test artifacts are archived with the full directory structure
- name: Install dependencies
run: |
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HostableWebCore
pip install aiohttp
shell: powershell
- name: Run Integration Tests
run: |
if ($Env:enhanced_logging -eq $True) {
Write-Host "List ports in use"
netstat -no
}
Write-Host "Run tests"
# Test parallelization is disabled until we can solve concurrent dotnet publish issues with ConsoleMF usage
$json = Get-Content "${{ env.integration_tests_path }}/xunit.runner.json" | ConvertFrom-Json
$json | Add-Member -Name "parallelizeAssembly" -Value $false -MemberType NoteProperty
$json | Add-Member -Name "parallelizeTestCollections" -Value $false -MemberType NoteProperty
# if ("${{ matrix.namespace }}" -like "Logging.*" ) {
# $json.parallelizeAssembly = $true
# $json.parallelizeTestCollections = $true
# }
$json | ConvertTo-Json | Out-File "${{ env.integration_tests_path }}/xunit.runner.json"
dotnet test ${{ env.integration_tests_path }}/NewRelic.Agent.IntegrationTests.dll --filter FullyQualifiedName~NewRelic.Agent.IntegrationTests.${{ matrix.namespace }} --no-build --nologo --logger "trx;LogFileName=C:\IntegrationTestWorkingDirectory\TestResults\${{ matrix.namespace }}_testResults.trx"
if ($Env:enhanced_logging -eq $True) {
Write-Host "Get HostableWebCore errors (if any)"
Get-EventLog -LogName Application -Source HostableWebCore -ErrorAction:Ignore
Write-Host "Get .NET Runtime errors (if any)"
Get-EventLog -LogName Application -Source ".NET Runtime" -EntryType "Error","Warning" -ErrorAction:Ignore
}
shell: powershell
- name: Archive IntegrationTestWorkingDirectory on Failure
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: integration-test-artifacts
path: |
C:\IntegrationTestWorkingDirectory\**\*.log
C:\IntegrationTestWorkingDirectory\**\*.config
if-no-files-found: error
- name: Archive Test Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: integration-test-artifacts
path: C:\IntegrationTestWorkingDirectory\TestResults\**\*TestResults.trx
if-no-files-found: error
run-integration-tests-linux-arm64:
needs: build-fullagent-msi
name: Run IntegrationTests linux-arm64
runs-on: ubuntu-22.04
if: false
permissions:
contents: read # for actions/checkout to fetch code
packages: write # for uraimo/run-on-arch-action to cache docker images
env:
test_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/IntegrationTests/TestResults
steps:
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Download Agent Home Folders
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: homefolders
path: src/Agent
- name: Run test commands
uses: uraimo/run-on-arch-action@a8003307a739516fdd80ee6d3da8924db811b8da # v2.5.0
with:
arch: aarch64
distro: ubuntu18.04
githubToken: ${{ github.token }}
env: |
test_secrets: '${{ secrets.TEST_SECRETS }}'
NR_DOTNET_TEST_SAVE_WORKING_DIRECTORY: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
install: |
apt-get update -q -y && apt-get install -q -y curl
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
mkdir -p /usr/share/dotnet
curl -sSL https://dotnetcli.azureedge.net/dotnet/Sdk/3.1.414/dotnet-sdk-3.1.414-linux-arm64.tar.gz | tar -xzC /usr/share/dotnet
curl -sSL https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.401/dotnet-sdk-5.0.401-linux-arm64.tar.gz | tar -xzC /usr/share/dotnet
curl -sSL https://dotnetcli.azureedge.net/dotnet/Sdk/6.0.100/dotnet-sdk-6.0.100-linux-arm64.tar.gz | tar -xzC /usr/share/dotnet
ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet
dotnet help
dockerRunArgs: |
--volume "${{ env.test_path }}:/tmp/IntegrationTestWorkingDirectory"
run: |
cd tests/Agent/IntegrationTests/IntegrationTests
echo $test_secrets | dotnet user-secrets set --project "../Shared"
dotnet test -f netcoreapp3.1 -c Release -l "trx" --filter "FullyQualifiedName~ApiCallsTestsCore|FullyQualifiedName~InfiniteTracingNetCoreLatestTests"
- name: Archive IntegrationTestWorkingDirectory on Failure
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: integration-test-artifacts-linux-arm64
path: ${{ env.test_path }}/**/*
if-no-files-found: error
- name: Archive Test Artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ always() }}
with:
name: integration-test-artifacts-linux-arm64
path: ${{ env.test_path }}/*.trx
if-no-files-found: error
run-unbounded-tests:
needs: [build-unbounded-tests]
name: Run Unbounded Tests
runs-on: windows-2022
strategy:
matrix:
namespace:
[
CosmosDB,
Couchbase,
Elasticsearch,
MongoDB,
Msmq,
MsSql,
MySql,
NServiceBus,
NServiceBus5,
Oracle,
Postgres,
RabbitMq,
Redis,
]
fail-fast: false # we don't want one test failure in one namespace to kill the other runs
env:
integration_tests_shared_project: ${{ github.workspace }}/tests/Agent/IntegrationTests/Shared
unbounded_tests_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/UnboundedIntegrationTests/bin/Release/net462
NR_DOTNET_TEST_SAVE_WORKING_DIRECTORY: 1
# Make this variable true to enable extra data-gathering and logging to help troubleshoot test failures, at the cost of additional time and resources
enhanced_logging: false
steps:
- name: My IP
run: (Invoke-WebRequest -uri "http://ifconfig.me/ip").Content
shell: powershell
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Download Agent Home Folders
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: homefolders
path: src/Agent
- name: Download Unbounded Integration Test Artifacts
uses: actions/download-artifact/@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: unboundedintegrationtests
# Should not need a path because the integration test artifacts are archived with the full directory structure
- name: Disable TLS 1.3
run: |
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.3\Client"
if(!(Test-Path $registryPath)) {
New-Item -Path $registryPath -Force
}
New-ItemProperty -Path $registryPath -Name "DisabledByDefault" -Value "1" -PropertyType DWORD -Force
New-ItemProperty -Path $registryPath -Name "Enabled" -Value "0" -PropertyType DWORD -Force
shell: powershell
- name: Install dependencies
run: |
Write-Host "Installing HostableWebCore Feature"
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HostableWebCore
Write-Host "Installing Msmq Features"
Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Server -All
Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-HTTP -All
Enable-WindowsOptionalFeature -Online -FeatureName MSMQ-Triggers -All
if ("${{ matrix.namespace }}" -eq "MsSql") {
Write-Host "Installing MSSQL CLI"
msiexec /i "${{ github.workspace }}\build\Tools\sqlncli.msi" IACCEPTSQLNCLILICENSETERMS=YES /quiet /qn /norestart
Start-Sleep 20 # Need to wait for install to finish -- takes only a few seconds, but we need to be sure.
}
shell: powershell
- name: Set up secrets
env:
INTEGRATION_TEST_SECRETS: ${{ secrets.UNBOUNDED_TEST_SECRETS }}
run: |
"$Env:INTEGRATION_TEST_SECRETS" | dotnet user-secrets set --project ${{ env.integration_tests_shared_project }}
shell: pwsh #this doesn't work with normal powershell due to UTF-8 BOM handling
- name: Start Local CosmosDB Emulator for CosmosDB Tests
if: matrix.namespace == 'CosmosDB'
uses: southpolesteve/cosmos-emulator-github-action@2b1168b52481f972890f5da2ff8f9d2cc3707804 # v1
- name: Run Unbounded Integration Tests
run: |
if ($Env:enhanced_logging -eq $True) {
Write-Host "List ports in use"
netstat -no
}
# Test parallelization is disabled until we can solve concurrent dotnet publish issues with ConsoleMF usage
$json = Get-Content "${{ env.unbounded_tests_path }}/xunit.runner.json" | ConvertFrom-Json
$json | Add-Member -Name "parallelizeAssembly" -Value $false -MemberType NoteProperty
$json | Add-Member -Name "parallelizeTestCollections" -Value $false -MemberType NoteProperty
$json | ConvertTo-Json | Out-File "${{ env.unbounded_tests_path }}/xunit.runner.json"
dotnet test ${{ env.unbounded_tests_path }}/NewRelic.Agent.UnboundedIntegrationTests.dll --filter FullyQualifiedName~NewRelic.Agent.UnboundedIntegrationTests.${{ matrix.namespace }} --no-build --nologo --logger "trx;LogFileName=C:\IntegrationTestWorkingDirectory\TestResults\${{ matrix.namespace }}_testResults.trx"
if ($Env:enhanced_logging -eq $True) {
Write-Host "Get HostableWebCore errors (if any)"
Get-EventLog -LogName Application -Source HostableWebCore -ErrorAction:Ignore
Write-Host "Get .NET Runtime errors (if any)"
Get-EventLog -LogName Application -Source ".NET Runtime" -EntryType "Error","Warning" -ErrorAction:Ignore
}
shell: powershell
- name: Archive IntegrationTestWorkingDirectory on Failure
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: integration-test-artifacts
path: |
C:\IntegrationTestWorkingDirectory\**\*.log
C:\IntegrationTestWorkingDirectory\**\*.config
if-no-files-found: error
- name: Archive Test Artifacts
if: ${{ always() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: integration-test-artifacts
path: C:\IntegrationTestWorkingDirectory\TestResults\**\*TestResults.trx
if-no-files-found: error
create-package-rpm:
needs: build-fullagent-msi
if: ${{ github.event.release }} || github.event_name == 'workflow_dispatch'
name: Create RPM Package
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
disable-sudo: true
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Download msi _build Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: msi-build-folder-artifacts
path: src/_build
- name: Download Agent Home Folders
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: homefolders
path: src/Agent
- name: Convert GPG Key Into File
id: write_gpgkey
run: |
filePath="/tmp/gpg.tar.bz2"
echo "${{ secrets.GPG_KEY }}" | base64 -d > $filePath
echo "filePath=$filePath" >> $GITHUB_OUTPUT
shell: bash
- name: Copy GPG Key to keys
run: |
mkdir ${{ github.workspace }}/build/Linux/keys
cp -f ${{ steps.write_gpgkey.outputs.filePath }} ${{ github.workspace }}/build/Linux/keys/gpg.tar.bz2
shell: bash
- name: Build RPM
run: |
agentVersion=${{ needs.build-fullagent-msi.outputs.agentVersion }}
if [[ "$agentVersion" =~ [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]]; then
major=$(echo $agentVersion | cut -d'.' -f1)
minor=$(echo $agentVersion | cut -d'.' -f2)
patch=$(echo $agentVersion | cut -d'.' -f3)
agentVersion="${major}.${minor}.${patch}"
echo "agentVersion is simplified to $agentVersion"
fi
cd ${{ github.workspace }}/build/Linux
docker-compose build build_rpm
docker-compose run -e AGENT_VERSION=$agentVersion -e GPG_KEYS=/keys/gpg.tar.bz2 build_rpm
shell: bash
- name: Archive RPM Package Artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: rpm-build-artifacts
path: ${{ github.workspace }}/src/_build/CoreArtifacts
if-no-files-found: error
create-package-deb:
needs: build-fullagent-msi
if: ${{ github.event.release }} || github.event_name == 'workflow_dispatch'
name: Create Debian package
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0
with:
disable-sudo: true
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Download Agent Home Folders
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: homefolders
path: src/Agent
- name: Download msi _build Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: msi-build-folder-artifacts
path: src/_build
- name: Build Debian Package
run: |
agentVersion=${{ needs.build-fullagent-msi.outputs.agentVersion }}
if [[ "$agentVersion" =~ [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]]; then
major=$(echo $agentVersion | cut -d'.' -f1)
minor=$(echo $agentVersion | cut -d'.' -f2)
patch=$(echo $agentVersion | cut -d'.' -f3)
agentVersion="${major}.${minor}.${patch}"
echo "agentVersion is simplified to $agentVersion"
fi
cd ${{ github.workspace }}/build/Linux
docker-compose build build_deb
docker-compose run -e AGENT_VERSION=$agentVersion build_deb
shell: bash
- name: Archive Debian Package Artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: debian-build-artifacts
path: ${{ github.workspace }}/src/_build/CoreArtifacts
if-no-files-found: error
run-artifactbuilder:
needs: [create-package-rpm, create-package-deb]
if: ${{ github.event.release }} || github.event_name == 'workflow_dispatch'
name: Run ArtifactBuilder
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0
- name: Download Agent Home Folders
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: homefolders
path: src/Agent
- name: Download msi _build Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: msi-build-folder-artifacts
path: src/_build
- name: Download Debian _build Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: debian-build-artifacts
path: src/_build/CoreArtifacts
- name: Download RPM _build Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: rpm-build-artifacts
path: src/_build/CoreArtifacts
- name: Download NewRelic.NuGetHelper
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: NewRelic.NuGetHelper
path: build/NewRelic.NuGetHelper/bin
- name: Download NewRelic.Agent.Extensions
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: NewRelic.Agent.Extensions
path: src/Agent/NewRelic/Agent/Extensions/NewRelic.Agent.Extensions/bin/Release
- name: Download NewRelic.OpenTracing.AmazonLambda.Tracer
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: NewRelic.OpenTracing.AmazonLambda.Tracer
path: src/AwsLambda/AwsLambdaOpenTracer/bin/Release/netstandard2.0-ILRepacked
- name: Run ArtifactBuilder
run: |
${{ github.workspace }}\build\package.ps1 -configuration Release -IncludeDownloadSite
shell: powershell
- name: Archive Deploy Artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: deploy-artifacts
path: |
${{ github.workspace }}\build\BuildArtifacts
${{ github.workspace }}\deploy
if-no-files-found: error
run-multiverse_testing_suite:
permissions:
contents: write
name: Build and Publish Multiverse Testing Suite
needs: build-fullagent-msi
if: ${{ github.event.release }}
uses: newrelic/newrelic-dotnet-agent/.github/workflows/multiverse_run.yml@main
with:
agentVersion: ${{ needs.build-fullagent-msi.outputs.agentVersion }}