Skip to content

Commit

Permalink
Add dedicated ci for Instrumentation.Owin project.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed Sep 22, 2023
1 parent 85ee94c commit 57adc0c
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ flags:
paths:
- src/OpenTelemetry.Exporter.OneCollector

unittests-Instrumentation.Owin:
carryforward: true
paths:
- src/OpenTelemetry.Instrumentation.Owin

unittests-Instrumentation.Process:
carryforward: true
paths:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/ci-Instrumentation.Owin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build OpenTelemetry.Instrumentation.Owin

on:
pull_request:
branches: [ 'main*', 'instrumentation*' ]
paths:
- '*/OpenTelemetry.Instrumentation.Owin*/**'
- 'build/**'
- '!**.md'

jobs:
call-build-test:
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: OpenTelemetry.Instrumentation.Owin
code-cov-name: Instrumentation.Owin

2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- '**.md'
- '*/OpenTelemetry.Exporter.Geneva*/**'
- '*/OpenTelemetry.Exporter.OneCollector*/**'
- '*/OpenTelemetry.Instrumentation.Owin*/**'
- '*/OpenTelemetry.Instrumentation.Process*/**'
- '*/OpenTelemetry.Instrumentation.Wcf*/**'

Expand Down Expand Up @@ -43,6 +44,7 @@ jobs:
-Exclude `
OpenTelemetry.Exporter.Geneva.Tests.csproj,
OpenTelemetry.Exporter.OneCollector.Tests.csproj,
OpenTelemetry.Instrumentation.Owin.Tests.csproj,
OpenTelemetry.Instrumentation.Process.Tests.csproj,
OpenTelemetry.Instrumentation.Wcf.Tests.csproj
Expand Down
57 changes: 6 additions & 51 deletions .github/workflows/package-Instrumentation.Owin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,58 +9,13 @@ on:
default: 'warning'
push:
tags:
- 'Instrumentation.Owin-*'
- 'Instrumentation.Owin-*' # trigger when we create a tag with prefix "Instrumentation.Owin-"

jobs:
build-test-pack:
runs-on: ${{ matrix.os }}
call-build-test-pack:
permissions:
contents: write
env:
PROJECT: OpenTelemetry.Instrumentation.Owin

strategy:
matrix:
os: [windows-latest]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all

- name: Setup dotnet
uses: actions/setup-dotnet@v3

- name: Install dependencies
run: dotnet restore src/${{env.PROJECT}}

- name: dotnet build ${{env.PROJECT}}
run: dotnet build src/${{env.PROJECT}} --configuration Release --no-restore -p:Deterministic=true

- name: dotnet test ${{env.PROJECT}}
run: dotnet test test/${{env.PROJECT}}.Tests

- name: dotnet pack ${{env.PROJECT}}
run: dotnet pack src/${{env.PROJECT}} --configuration Release --no-build

- name: Publish Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{env.PROJECT}}-packages
path: '**/${{env.PROJECT}}/bin/**/*.*nupkg'

- name: Publish Nuget
run: |
nuget push **/${{env.PROJECT}}/bin/**/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_TOKEN }} -SymbolApiKey ${{ secrets.NUGET_TOKEN }}
- name: Create GitHub Prerelease
if: ${{ (contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') || contains(github.ref_name, '-rc.')) }}
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{env.PROJECT}}/CHANGELOG.md) for details." --prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
if: ${{ !(contains(github.ref_name, '-alpha.') || contains(github.ref_name, '-beta.') || contains(github.ref_name, '-rc.')) }}
run: gh release create ${{ github.ref_name }} --title ${{ github.ref_name }} --verify-tag --notes "See [CHANGELOG](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/${{ github.ref_name }}/src/${{env.PROJECT}}/CHANGELOG.md) for details." --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ./.github/workflows/Component.Package.yml
with:
project-name: OpenTelemetry.Instrumentation.Owin
secrets: inherit
26 changes: 26 additions & 0 deletions build/Projects/OpenTelemetry.Instrumentation.Owin.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project>

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

<ItemGroup>
<SolutionProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Owin\OpenTelemetry.Instrumentation.Owin.csproj" />
<SolutionProjects Include="$(RepoRoot)\test\OpenTelemetry.Instrumentation.Owin.Tests\OpenTelemetry.Instrumentation.Owin.Tests.csproj" />

<PackProjects Include="$(RepoRoot)\src\OpenTelemetry.Instrumentation.Owin\OpenTelemetry.Instrumentation.Owin.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>

</Project>
2 changes: 2 additions & 0 deletions opentelemetry-dotnet-contrib.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\ci-Exporter.Geneva.yml = .github\workflows\ci-Exporter.Geneva.yml
.github\workflows\ci-Exporter.OneCollector-Integration.yml = .github\workflows\ci-Exporter.OneCollector-Integration.yml
.github\workflows\ci-Exporter.OneCollector.yml = .github\workflows\ci-Exporter.OneCollector.yml
.github\workflows\ci-Instrumentation.Owin.yml = .github\workflows\ci-Instrumentation.Owin.yml
.github\workflows\ci-Instrumentation.Process.yml = .github\workflows\ci-Instrumentation.Process.yml
.github\workflows\ci-Instrumentation.Wcf.yml = .github\workflows\ci-Instrumentation.Wcf.yml
.github\workflows\ci-md.yml = .github\workflows\ci-md.yml
Expand Down Expand Up @@ -310,6 +311,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{04
ProjectSection(SolutionItems) = preProject
build\Projects\OpenTelemetry.Exporter.Geneva.proj = build\Projects\OpenTelemetry.Exporter.Geneva.proj
build\Projects\OpenTelemetry.Exporter.OneCollector.proj = build\Projects\OpenTelemetry.Exporter.OneCollector.proj
build\Projects\OpenTelemetry.Instrumentation.Owin.proj = build\Projects\OpenTelemetry.Instrumentation.Owin.proj
build\Projects\OpenTelemetry.Instrumentation.Process.proj = build\Projects\OpenTelemetry.Instrumentation.Process.proj
build\Projects\OpenTelemetry.Instrumentation.Wcf.proj = build\Projects\OpenTelemetry.Instrumentation.Wcf.proj
EndProjectSection
Expand Down

0 comments on commit 57adc0c

Please sign in to comment.