Skip to content

Commit

Permalink
CI tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed May 24, 2024
1 parent 361a4b9 commit 7f51e55
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ ignore:
- "test"

flags:
unittests-Solution-Stable:
unittests-Solution:
carryforward: true
paths:
- src

unittests-Solution-Experimental:
unittests-Project-Stable:
carryforward: true
paths:
- src

unittests-Instrumentation-Stable:
unittests-Project-Experimental:
carryforward: true
paths:
- src

unittests-Instrumentation-Experimental:
unittests-UnstableCoreLibraries-Experimental:
carryforward: true
paths:
- src
31 changes: 22 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
build: ['build/**', '.github/**/*.yml', '**/*.targets', '**/*.props']
shared: ['src/Shared/**']
code: ['**.cs', '**.csproj', '.editorconfig']
solution: ['OpenTelemetry.sln']
packaged-code: ['src/**', '!**/*.md']
api-code: ['*/OpenTelemetry.Api*/**', '!**/*.md']
api-packages: ['src/OpenTelemetry.Api*/**', '!**/*.md']
Expand All @@ -50,29 +51,40 @@ jobs:
|| contains(needs.detect-changes.outputs.changes, 'build')
uses: ./.github/workflows/dotnet-format.yml

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

build-test-project-stable:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: './build/OpenTelemetry.proj'
project-build-commands: '-p:ExposeExperimentalFeatures=false'
code-cov-name: 'Solution-Stable'
code-cov-name: 'Project-Stable'

build-test-solution-experimental:
build-test-project-experimental:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: 'OpenTelemetry.sln'
project-name: './build/OpenTelemetry.proj'
project-build-commands: '-p:ExposeExperimentalFeatures=true'
code-cov-name: 'Solution-Experimental'
code-cov-name: 'Project-Experimental'

# Build unstable core libraries using stable packages released to NuGet
build-test-unstable-core:
Expand All @@ -85,7 +97,7 @@ jobs:
with:
project-name: './build/UnstableCoreLibraries.proj'
project-build-commands: '-p:RunningDotNetPack=true -p:ExposeExperimentalFeatures=true'
code-cov-name: 'Unstable-Core'
code-cov-name: 'UnstableCoreLibraries-Experimental'

otlp-integration-test:
needs: detect-changes
Expand Down Expand Up @@ -163,8 +175,9 @@ jobs:
detect-changes,
lint-md,
lint-dotnet-format,
build-test-solution-stable,
build-test-solution-experimental,
build-test-solution,
build-test-project-stable,
build-test-project-experimental,
build-test-unstable-core,
otlp-integration-test,
w3c-trace-context-integration-test,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4

- name: dotnet pack OpenTelemetry.proj
run: dotnet pack OpenTelemetry.proj --configuration Release
- name: dotnet pack
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
8 changes: 4 additions & 4 deletions .github/workflows/package-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4

- name: Pack
run: dotnet pack OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=false /p:RunningDotNetPack=true
- name: dotnet pack
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=false /p:RunningDotNetPack=true

run-package-validation-experimental:
runs-on: windows-latest
Expand All @@ -37,5 +37,5 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4

- name: Pack
run: dotnet pack OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=true /p:RunningDotNetPack=true
- name: dotnet pack
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=true /p:RunningDotNetPack=true
6 changes: 3 additions & 3 deletions .github/workflows/publish-packages-1.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ jobs:
uses: actions/setup-dotnet@v4

- name: dotnet restore
run: dotnet restore OpenTelemetry.proj -p:RunningDotNetPack=true
run: dotnet restore ./build/OpenTelemetry.proj -p:RunningDotNetPack=true

- name: dotnet build
run: dotnet build OpenTelemetry.proj --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }} -p:RunningDotNetPack=true
run: dotnet build ./build/OpenTelemetry.proj --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }} -p:RunningDotNetPack=true

- name: dotnet pack
run: dotnet pack OpenTelemetry.proj --configuration Release --no-restore --no-build -p:PackTag=${{ github.ref_type == 'tag' && github.ref_name || inputs.tag || '' }}
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release --no-restore --no-build -p:PackTag=${{ github.ref_type == 'tag' && github.ref_name || inputs.tag || '' }}

- name: Publish Artifacts
id: upload-artifacts
Expand Down
2 changes: 1 addition & 1 deletion OpenTelemetry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
LICENSE.TXT = LICENSE.TXT
NuGet.config = NuGet.config
OpenTelemetry.proj = OpenTelemetry.proj
README.md = README.md
THIRD-PARTY-NOTICES.TXT = THIRD-PARTY-NOTICES.TXT
VERSIONING.md = VERSIONING.md
Expand All @@ -38,6 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
build\OpenTelemetry.prod.loose.ruleset = build\OpenTelemetry.prod.loose.ruleset
build\OpenTelemetry.prod.ruleset = build\OpenTelemetry.prod.ruleset
build\OpenTelemetry.proj = build\OpenTelemetry.proj
build\OpenTelemetry.test.ruleset = build\OpenTelemetry.test.ruleset
build\RELEASING.md = build\RELEASING.md
build\stylecop.json = build\stylecop.json
Expand Down
4 changes: 1 addition & 3 deletions OpenTelemetry.proj → build/OpenTelemetry.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
</ItemGroup>

<ItemGroup Condition="'$(RunningDotNetPack)' == 'true'">
<!-- Skip building these projects when publish packages workflow runs as
these projects need to depend upon instrumentation libraries taking a
project reference instead of package reference on API/SDK -->
<!-- Skip building these projects when publish packages workflow runs -->
<SolutionProjects Remove="docs\**\**\*.csproj" />
<SolutionProjects Remove="examples\**\*.csproj" />
<SolutionProjects Remove="@(TestProjects)" />
Expand Down

0 comments on commit 7f51e55

Please sign in to comment.