Skip to content

Commit

Permalink
[repo] Add dedicated CI for persistent storage projects (#1397)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Oct 14, 2023
1 parent 0f431e4 commit 4db5ac6
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 135 deletions.
5 changes: 5 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,8 @@ flags:
paths:
- src/OpenTelemetry.Instrumentation.Wcf

unittests-PersistentStorage:
carryforward: true
paths:
- src/OpenTelemetry.PersistentStorage.Abstractions
- src/OpenTelemetry.PersistentStorage.FileSystem
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,21 @@ jobs:
geneva: ['*/OpenTelemetry.Exporter.Geneva*/**', '!**/*.md']
onecollector: ['*/OpenTelemetry.Instrumentation.OneCollector*/**', '!**/*.md']
owin: ['*/OpenTelemetry.Instrumentation.Owin*/**', 'examples/owin/**', '!**/*.md']
persistentstorage: ['*/OpenTelemetry.PersistentStorage*/**', '!**/*.md']
process: ['*/OpenTelemetry.Instrumentation.Process*/**', 'examples/process-instrumentation/**', '!**/*.md']
redis: ['*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**', 'examples/redis/**', '!**/*.md']
wcf: ['*/OpenTelemetry.Instrumentation.Wcf*/**', 'examples/wcf/**', '!**/*.md']
solution: [
'src/**',
'test/**',
'examples/**',
'!*/OpenTelemetry.Instrumentation.AspNet*/**',
'!examples/AspNet/**',
'!*/OpenTelemetry.Exporter.Geneva*/**',
'!*/OpenTelemetry.Exporter.OneCollector*/**',
'!*/OpenTelemetry.Instrumentation.Owin*/**',
'!examples/owin/**',
'!*/OpenTelemetry.PersistentStorage*/**',
'!*/OpenTelemetry.Instrumentation.Process*/**',
'!examples/process-instrumentation/**',
'!*/OpenTelemetry.Instrumentation.StackExchangeRedis*/**',
Expand Down Expand Up @@ -103,6 +107,17 @@ jobs:
os-list: '[ "windows-latest" ]'
tfm-list: '[ "net462" ]'

build-test-persistentstorage:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'persistentstorage')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.PersistentStorage
code-cov-name: PersistentStorage

build-test-process:
needs: detect-changes
if: |
Expand Down Expand Up @@ -186,7 +201,9 @@ jobs:
OpenTelemetry.Instrumentation.Owin.Tests.csproj,
OpenTelemetry.Instrumentation.Process.Tests.csproj,
OpenTelemetry.Instrumentation.StackExchangeRedis.Tests.csproj,
OpenTelemetry.Instrumentation.Wcf.Tests.csproj
OpenTelemetry.Instrumentation.Wcf.Tests.csproj,
OpenTelemetry.PersistentStorage.Abstractions.csproj,
OpenTelemetry.PersistentStorage.FileSystem.csproj
ForEach ($project in $projects)
{
Expand Down Expand Up @@ -220,6 +237,7 @@ jobs:
build-test-geneva,
build-test-onecollector,
build-test-owin,
build-test-persistentstorage,
build-test-process,
build-test-redis,
build-test-redis-integration,
Expand Down
63 changes: 0 additions & 63 deletions .github/workflows/package-PersistentStorage.Abstractions.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/package-PersistentStorage.FileSystem.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/package-PersistentStorage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pack OpenTelemetry.PersistentStorage

# Note: This releases OpenTelemetry.PersistentStorage.Abstractions & OpenTelemetry.PersistentStorage.FileSystem

on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
push:
tags:
- 'PersistentStorage-*' # trigger when we create a tag with prefix "PersistentStorage-"

jobs:
call-build-test-pack:
permissions:
contents: write
uses: ./.github/workflows/Component.Package.yml
with:
project-name: OpenTelemetry.PersistentStorage
release-name: 'OpenTelemetry Persistent Storage Packages'
secrets: inherit
34 changes: 34 additions & 0 deletions build/Projects/OpenTelemetry.PersistentStorage.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project>

<PropertyGroup>
<RepoRoot>$([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory)).Parent.Parent.FullName)</RepoRoot>
</PropertyGroup>

<ItemGroup>
<SolutionProjects Include="$(RepoRoot)\src\OpenTelemetry.PersistentStorage.Abstractions\OpenTelemetry.PersistentStorage.Abstractions.csproj" />
<SolutionProjects Include="$(RepoRoot)\src\OpenTelemetry.PersistentStorage.FileSystem\OpenTelemetry.PersistentStorage.FileSystem.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.PersistentStorage.FileSystem.Tests\OpenTelemetry.PersistentStorage.FileSystem.Tests.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.PersistentStorage.Abstractions\OpenTelemetry.PersistentStorage.Abstractions.csproj" />
<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.PersistentStorage.FileSystem\OpenTelemetry.PersistentStorage.FileSystem.csproj" />

<TestProjects Include="$(RepoRoot)\test\OpenTelemetry.PersistentStorage.FileSystem.Tests\OpenTelemetry.PersistentStorage.FileSystem.Tests.csproj" />
</ItemGroup>

<Target Name="Build">
<MSBuild Projects="@(SolutionProjects)" Targets="Build" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="Restore">
<MSBuild Projects="@(SolutionProjects)" Targets="Restore" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="Pack">
<MSBuild Projects="@(PackProjects)" Targets="Pack" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

</Project>
4 changes: 2 additions & 2 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\package-Instrumentation.Runtime.yml = .github\workflows\package-Instrumentation.Runtime.yml
.github\workflows\package-Instrumentation.StackExchangeRedis.yml = .github\workflows\package-Instrumentation.StackExchangeRedis.yml
.github\workflows\package-Instrumentation.Wcf.yml = .github\workflows\package-Instrumentation.Wcf.yml
.github\workflows\package-PersistentStorage.Abstractions.yml = .github\workflows\package-PersistentStorage.Abstractions.yml
.github\workflows\package-PersistentStorage.FileSystem.yml = .github\workflows\package-PersistentStorage.FileSystem.yml
.github\workflows\sanitycheck.yml = .github\workflows\sanitycheck.yml
.github\workflows\package-PersistentStorage.yml = .github\workflows\package-PersistentStorage.yml
.github\workflows\stale.yml = .github\workflows\stale.yml
EndProjectSection
EndProject
Expand Down Expand Up @@ -308,6 +307,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{04
build\Projects\OpenTelemetry.Instrumentation.Process.proj = build\Projects\OpenTelemetry.Instrumentation.Process.proj
build\Projects\OpenTelemetry.Instrumentation.StackExchangeRedis.proj = build\Projects\OpenTelemetry.Instrumentation.StackExchangeRedis.proj
build\Projects\OpenTelemetry.Instrumentation.Wcf.proj = build\Projects\OpenTelemetry.Instrumentation.Wcf.proj
build\Projects\OpenTelemetry.PersistentStorage.proj = build\Projects\OpenTelemetry.PersistentStorage.proj
EndProjectSection
EndProject
Global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFrameworks Condition="'$(Configuration)' == 'Debug'">net6.0;$(TargetFrameworks)</TargetFrameworks> <!-- Added just to get proper nullable analysis in IDE -->
<IncludeSharedExceptionExtensionsSource>true</IncludeSharedExceptionExtensionsSource>
<Description>OpenTelemetry Persistent Storage Abstractions</Description>
<MinVerTagPrefix>PersistentStorage.Abstractions-</MinVerTagPrefix>
<MinVerTagPrefix>PersistentStorage-</MinVerTagPrefix>
<NoWarn>$(NoWarn),1591</NoWarn>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
<TargetFrameworks Condition="'$(Configuration)' == 'Debug'">net6.0;$(TargetFrameworks)</TargetFrameworks> <!-- Added just to get proper nullable analysis in IDE -->
<IncludeSharedExceptionExtensionsSource>true</IncludeSharedExceptionExtensionsSource>
<Description>OpenTelemetry Persistent Storage</Description>
<MinVerTagPrefix>PersistentStorage.FileSystem-</MinVerTagPrefix>
<MinVerTagPrefix>PersistentStorage-</MinVerTagPrefix>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn),1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.PersistentStorage.Abstractions\OpenTelemetry.PersistentStorage.Abstractions.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\Shared\NullableAttributes.cs" Link="Includes\NullableAttributes.cs" />
<PackageReference Include="OpenTelemetry.PersistentStorage.Abstractions" Version="1.0.0" />
</ItemGroup>

</Project>

0 comments on commit 4db5ac6

Please sign in to comment.