[repo] CI improvements (#5023)

Co-authored-by: Yun-Ting <yunl@microsoft.com>
Co-authored-by: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com>
This commit is contained in:
Mikel Blanchard 2024-01-08 13:09:28 -08:00 committed by GitHub
parent 6250307cb2
commit 88493d257c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 342 additions and 456 deletions

31
.github/codecov.yml vendored
View File

@ -23,7 +23,32 @@ comment:
require_changes: no
ignore:
- "docs/**/*"
- "examples/**/*"
- "test/**/*"
- "**.md"
- ".github"
- ".vscode"
- "build"
- "docs"
- "examples"
- "src/Shared"
- "test"
flags:
unittests-Solution-Stable:
carryforward: true
paths:
- src
unittests-Solution-Experimental:
carryforward: true
paths:
- src
unittests-Instrumentation-Stable:
carryforward: true
paths:
- src
unittests-Instrumentation-Experimental:
carryforward: true
paths:
- src

View File

@ -0,0 +1,80 @@
# Called by ci.yml to build & test project files
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Build Component
on:
workflow_call:
inputs:
project-name:
required: true
type: string
project-build-commands:
default: ''
required: false
type: string
code-cov-name:
required: true
type: string
code-cov-prefix:
default: 'unittests'
required: false
type: string
os-list:
default: '[ "windows-latest", "ubuntu-latest" ]'
required: false
type: string
tfm-list:
default: '[ "net462", "net6.0", "net7.0", "net8.0" ]'
required: false
type: string
jobs:
build-test:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: ${{ fromJSON(inputs.os-list) }}
version: ${{ fromJSON(inputs.tfm-list) }}
exclude:
- os: ubuntu-latest
version: net462
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
# retrieve them all.
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: dotnet restore ${{ inputs.project-name }}
run: dotnet restore ${{ inputs.project-name }} ${{ inputs.project-build-commands }}
- name: dotnet build ${{ inputs.project-name }}
run: dotnet build ${{ inputs.project-name }} --configuration Release --no-restore ${{ inputs.project-build-commands }}
- name: dotnet test ${{ inputs.project-name }}
run: dotnet test ${{ inputs.project-name }} --collect:"Code Coverage" --results-directory:TestResults --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true
- name: Install coverage tool
run: dotnet tool install -g dotnet-coverage
- name: Merging test results
run: dotnet-coverage merge -r -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/*.coverage
- name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
uses: codecov/codecov-action@v3.1.4
continue-on-error: true # Note: Don't fail for upload failures
env:
OS: ${{ matrix.os }}
TFM: ${{ matrix.version }}
with:
file: TestResults/Cobertura.xml
env_vars: OS,TFM
flags: ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
name: Code Coverage for ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} on [${{ matrix.os }}.${{ matrix.version }}]

View File

@ -1,26 +0,0 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# Description: This workflow exists to unblock documentation-only PRs.
# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow.
name: Publish AOTCompatibility testApp
on:
pull_request:
branches: [ 'main*' ]
paths:
- '**.md'
jobs:
aot-test:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ ubuntu-latest ]
version: [ net8.0 ]
runs-on: ${{ matrix.os }}
steps:
- run: 'echo "No build required"'

View File

@ -1,33 +0,0 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# Description: This workflow exists to unblock documentation-only PRs.
# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow.
name: Coyote Concurrency Tests
on:
push:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths:
- '**.md'
jobs:
coyote-concurrency-tests:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net8.0 ]
project: [ OpenTelemetry.Tests, OpenTelemetry.Api.Tests ]
runs-on: ${{ matrix.os }}
steps:
- run: 'echo "No build required"'

View File

@ -1,28 +0,0 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# Description: This workflow exists to unblock documentation-only PRs.
# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow.
name: Test instrumentation libraries
on:
pull_request:
branches: [ 'main*' ]
paths:
- '**.md'
jobs:
build-test:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'

View File

@ -1,41 +0,0 @@
name: Test instrumentation libraries # test instrumentation libraries with latest stable version of API/SDK as they are packed against it
on:
push:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
jobs:
build-test:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: dotnet restore
run: dotnet restore ./build/InstrumentationLibraries.proj -p:RunningDotNetPack=true
- name: dotnet build
run: dotnet build ./build/InstrumentationLibraries.proj --configuration Release --no-restore -p:RunningDotNetPack=true
- name: dotnet test
run: dotnet test **/bin/Release/${{ matrix.version }}/OpenTelemetry.Instrumentation*.Tests.dll --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed"

View File

@ -1,41 +0,0 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# Description: This workflow exists to unblock documentation-only PRs.
# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow.
name: Build
on:
pull_request:
branches: [ 'main*' ]
paths:
- '**.md'
jobs:
build-test-stable:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'
build-test-experimental:
strategy:
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'

View File

@ -1,68 +1,182 @@
name: Build
on:
push:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
jobs:
build-test-stable:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
lint-misspell-sanitycheck:
uses: ./.github/workflows/sanitycheck.yml
runs-on: ${{ matrix.os }}
detect-changes:
runs-on: windows-latest
outputs:
changes: ${{ steps.changes.outputs.changes }}
steps:
- uses: actions/checkout@v4
- uses: AurorNZ/paths-filter@v3
id: changes
with:
fetch-depth: 0 # fetching all
filters: |
md: ['**.md']
build: ['build/**', '.github/**/*.yml', '**/*.targets', '**/*.props']
shared: ['src/Shared/**']
code: ['**.cs', '**.csproj', '.editorconfig']
packaged-code: ['src/**', '!**/*.md']
api-code: ['*/OpenTelemetry.Api*/**', '!**/*.md']
api-packages: ['src/OpenTelemetry.Api*/**', '!**/*.md']
instrumentation: ['*/OpenTelemetry.Instrumentation*/**', 'test/TestApp.AspNetCore/**', '!**/*.md']
instrumentation-packages: ['src/OpenTelemetry.Instrumentation*/**', '!**/*.md']
sdk-code: ['src/OpenTelemetry/**', 'test/OpenTelemetry.Tests/**', '!**/*.md']
sdk-package: ['src/OpenTelemetry/**', '!**/*.md']
otlp: ['*/OpenTelemetry.Exporter.OpenTelemetryProtocol*/**', '!**/*.md']
- name: Setup dotnet
uses: actions/setup-dotnet@v4
lint-md:
needs: detect-changes
if: contains(needs.detect-changes.outputs.changes, 'md')
uses: ./.github/workflows/markdownlint.yml
- name: Install dependencies
run: dotnet restore
lint-dotnet-format:
needs: detect-changes
if: contains(needs.detect-changes.outputs.changes, 'code')
uses: ./.github/workflows/dotnet-format.yml
- name: Build
run: dotnet build --configuration Release --no-restore --property:ExposeExperimentalFeatures=false
build-test-solution-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: 'OpenTelemetry.sln'
project-build-commands: '-p:ExposeExperimentalFeatures=false'
code-cov-name: 'Solution-Stable'
- name: Test ${{ matrix.version }}
run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --logger:"console;verbosity=detailed"
build-test-solution-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-build-commands: '-p:ExposeExperimentalFeatures=true'
code-cov-name: 'Solution-Experimental'
build-test-experimental:
# Build instrumentation libraries using stable packages released to NuGet
build-test-instrumentation-stable:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'instrumentation-packages')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: './build/InstrumentationLibraries.proj'
project-build-commands: '-p:RunningDotNetPack=true -p:ExposeExperimentalFeatures=false'
code-cov-name: 'Instrumentation-Stable'
# Build instrumentation libraries using stable packages released to NuGet
build-test-instrumentation-experimental:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'instrumentation-packages')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: './build/InstrumentationLibraries.proj'
project-build-commands: '-p:RunningDotNetPack=true -p:ExposeExperimentalFeatures=true'
code-cov-name: 'Instrumentation-Experimental'
otlp-integration-test:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'api-packages')
|| contains(needs.detect-changes.outputs.changes, 'sdk-package')
|| contains(needs.detect-changes.outputs.changes, 'otlp')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0, net8.0 ]
exclude:
- os: ubuntu-latest
version: net462
runs-on: ${{ matrix.os }}
version: [ net6.0, net7.0, net8.0 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
- uses: actions/checkout@v4
- name: Run OTLP Exporter docker-compose
run: docker-compose --file=test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
- name: Setup dotnet
uses: actions/setup-dotnet@v4
w3c-trace-context-integration-test:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'api-packages')
|| contains(needs.detect-changes.outputs.changes, 'sdk-package')
|| contains(needs.detect-changes.outputs.changes, 'instrumentation')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ net6.0, net7.0 ]
steps:
- uses: actions/checkout@v4
- name: Run W3C Trace Context docker-compose
run: docker-compose --file=test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
- name: Install dependencies
run: dotnet restore
validate-packages:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'packaged-code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/package-validation.yml
- name: Build
run: dotnet build --configuration Release --no-restore --property:ExposeExperimentalFeatures=true
generate-docs:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'packaged-code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/docfx.yml
- name: Test ${{ matrix.version }}
run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --logger:"console;verbosity=detailed"
verify-aot-compat:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'packaged-code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/verifyaotcompat.yml
concurrency-tests:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'api-code')
|| contains(needs.detect-changes.outputs.changes, 'sdk-code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/concurrency-tests.yml
build-test:
needs: [
lint-misspell-sanitycheck,
detect-changes,
lint-md,
lint-dotnet-format,
build-test-solution-stable,
build-test-solution-experimental,
build-test-instrumentation-stable,
build-test-instrumentation-experimental,
otlp-integration-test,
w3c-trace-context-integration-test,
validate-packages,
generate-docs,
verify-aot-compat,
concurrency-tests
]
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
runs-on: windows-latest
steps:
- run: echo 'build complete'

View File

@ -1,52 +0,0 @@
name: Code Coverage
on:
push:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
jobs:
build-test-report:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore --property:ExposeExperimentalFeatures=true
- name: Test
run: dotnet test --collect:"Code Coverage" --results-directory:"TestResults" --configuration Release --no-restore --no-build -- RunConfiguration.DisableAppDomain=true
- name: Install coverage tool
run: dotnet tool install -g dotnet-coverage
- name: Merging test results
run: dotnet-coverage merge -r -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/*.coverage
- uses: codecov/codecov-action@v3.1.4
env:
OS: ${{ matrix.os }}
with:
file: TestResults/Cobertura.xml
env_vars: OS
flags: unittests
name: Code Coverage for ${{ matrix.os }}

View File

@ -1,17 +1,12 @@
name: Coyote Concurrency Tests
# Called by ci.yml to run coyote concurrency tests
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Concurrency Tests
on:
push:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
workflow_call:
jobs:
coyote-concurrency-tests:
run-concurrency-tests:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
@ -23,8 +18,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
- name: Setup dotnet
uses: actions/setup-dotnet@v4

View File

@ -1,13 +1,12 @@
name: docfx
# Called by ci.yml to run documentation build
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Build docfx
on:
push:
branches: [ 'main*' ]
pull_request:
branches: [ 'main*' ]
workflow_call:
jobs:
build:
run-docfx-build:
runs-on: windows-latest
steps:

View File

@ -1,27 +0,0 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# Description: This workflow exists to unblock documentation-only PRs.
# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow.
name: dotnet format
on:
pull_request:
branches: [ 'main*' ]
paths:
- '**.md'
jobs:
check-format-stable:
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'
check-format-experimental:
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'

View File

@ -1,19 +1,12 @@
name: dotnet format
# Called by ci.yml to perform dotnet format linting
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Lint - dotnet format
on:
push:
branches: [ 'main*' ]
paths:
- '**.cs'
- '.editorconfig'
pull_request:
branches: [ 'main*' ]
paths:
- '**.cs'
- '.editorconfig'
workflow_call:
jobs:
check-format-stable:
run-dotnet-format-stable:
runs-on: windows-latest
steps:
@ -31,7 +24,7 @@ jobs:
env:
ExposeExperimentalFeatures: false
check-format-experimental:
run-dotnet-format-experimental:
runs-on: windows-latest
steps:

View File

@ -1,39 +0,0 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# See also: https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# Description: This workflow exists to unblock documentation-only PRs.
# IMPORTANT: This workflow MUST use the same 'name' and 'matrix' as the non -md workflow.
name: Integration Tests
on:
pull_request:
branches: [ 'main*' ]
paths:
- '**.md'
jobs:
sql-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ net6.0, net7.0, net8.0 ]
steps:
- run: 'echo "No build required"'
w3c-trace-context-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ net6.0, net7.0, net8.0 ]
steps:
- run: 'echo "No build required"'
otlp-exporter-test:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ net6.0, net7.0 , net8.0 ]
steps:
- run: 'echo "No build required"'

View File

@ -1,36 +0,0 @@
name: Integration Tests
on:
push:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
jobs:
w3c-trace-context-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ net6.0, net7.0 ]
steps:
- uses: actions/checkout@v4
- name: Run W3C Trace Context docker-compose.integration
run: docker-compose --file=test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
otlp-exporter-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ net6.0, net7.0, net8.0 ]
steps:
- uses: actions/checkout@v4
- name: Run OTLP Exporter docker-compose.integration
run: docker-compose --file=test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build

View File

@ -1,17 +1,12 @@
name: markdownlint
# Called by ci.yml to perform markdown linting
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Lint - Markdown
on:
push:
branches: [ 'main*' ]
paths:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths:
- '**.md'
workflow_call:
jobs:
build:
run-markdownlint:
runs-on: ubuntu-latest
steps:

View File

@ -1,19 +1,21 @@
# Called by ci.yml to perform package validation
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Package Validation
on:
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
workflow_call:
jobs:
build-test-stable:
run-package-validation-stable:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
# retrieve them all.
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@ -21,13 +23,16 @@ jobs:
- name: Pack
run: dotnet pack OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=false
build-test-experimental:
run-package-validation-experimental:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
# retrieve them all.
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4

View File

@ -5,7 +5,7 @@
################### IMPORTANT ###################
#################################################
name: Pack and publish to MyGet
name: Build, pack, and publish to MyGet
on:
release:
@ -14,13 +14,16 @@ on:
- cron: '0 0 * * *' # once in a day at 00:00
jobs:
build-pack:
build-pack-publish:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
# retrieve them all.
fetch-depth: 0
ref: ${{ github.ref || 'main' }}
- name: Setup dotnet
@ -33,7 +36,7 @@ jobs:
run: dotnet 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-build --no-restore
run: dotnet pack OpenTelemetry.proj --configuration Release --no-restore --no-build
- name: Publish Artifacts
uses: actions/upload-artifact@v4

View File

@ -1,13 +1,12 @@
name: sanitycheck
# Called by ci.yml to perform general linting
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Lint - Spelling & Encoding
on:
push:
branches: [ 'main*' ]
pull_request:
branches: [ 'main*' ]
workflow_call:
jobs:
misspell:
run-misspell:
runs-on: ubuntu-latest
steps:
@ -22,7 +21,7 @@ jobs:
- name: run misspell
run: ./bin/misspell -error .
encoding:
run-sanitycheck:
runs-on: ubuntu-latest
steps:

View File

@ -1,19 +1,15 @@
name: Publish AOTCompatibility testApp
# Called by ci.yml to perform AOT validation
# See: https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
name: Publish & Verify AOT Compatibility
on:
push:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
pull_request:
branches: [ 'main*' ]
paths-ignore:
- '**.md'
workflow_call:
jobs:
aot-test:
run-verify-aot-compat:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ ubuntu-latest ]
version: [ net8.0 ]
@ -21,8 +17,6 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetching all
- name: Setup dotnet
uses: actions/setup-dotnet@v4
@ -30,3 +24,4 @@ jobs:
- name: publish AOT testApp, assert static analysis warning count, and run the app
shell: pwsh
run: .\build\test-aot-compatibility.ps1 ${{ matrix.version }}

View File

@ -33,6 +33,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\docfx.cmd = build\docfx.cmd
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
build\docker-compose.net7.0.yml = build\docker-compose.net7.0.yml
build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
build\finalize-publicapi.ps1 = build\finalize-publicapi.ps1
build\GlobalAttrExclusions.txt = build\GlobalAttrExclusions.txt
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
@ -77,6 +78,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.Exporter.Open
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F1D0972B-38CF-49C2-9F4B-4C5DE02FB71D}"
ProjectSection(SolutionItems) = preProject
.github\codecov.yml = .github\codecov.yml
.github\CODEOWNERS = .github\CODEOWNERS
.github\PULL_REQUEST_TEMPLATE.md = .github\PULL_REQUEST_TEMPLATE.md
EndProjectSection
@ -90,26 +92,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E69578EB-B456-4062-A645-877CD964528B}"
ProjectSection(SolutionItems) = preProject
.github\workflows\ci-aot-md.yml = .github\workflows\ci-aot-md.yml
.github\workflows\ci-aot.yml = .github\workflows\ci-aot.yml
.github\workflows\ci-concurrency-md.yml = .github\workflows\ci-concurrency-md.yml
.github\workflows\ci-concurrency.yml = .github\workflows\ci-concurrency.yml
.github\workflows\ci-instrumentation-libraries-md.yml = .github\workflows\ci-instrumentation-libraries-md.yml
.github\workflows\ci-instrumentation-libraries.yml = .github\workflows\ci-instrumentation-libraries.yml
.github\workflows\ci-md.yml = .github\workflows\ci-md.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
.github\workflows\code-coverage.yml = .github\workflows\code-coverage.yml
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
.github\workflows\Component.BuildTest.yml = .github\workflows\Component.BuildTest.yml
.github\workflows\concurrency-tests.yml = .github\workflows\concurrency-tests.yml
.github\workflows\docfx.yml = .github\workflows\docfx.yml
.github\workflows\dotnet-format-md.yml = .github\workflows\dotnet-format-md.yml
.github\workflows\dotnet-format.yml = .github\workflows\dotnet-format.yml
.github\workflows\integration-md.yml = .github\workflows\integration-md.yml
.github\workflows\integration.yml = .github\workflows\integration.yml
.github\workflows\markdownlint.yml = .github\workflows\markdownlint.yml
.github\workflows\package-validation.yml = .github\workflows\package-validation.yml
.github\workflows\publish-packages-1.0.yml = .github\workflows\publish-packages-1.0.yml
.github\workflows\sanitycheck.yml = .github\workflows\sanitycheck.yml
.github\workflows\stale.yml = .github\workflows\stale.yml
.github\workflows\verifyaotcompat.yml = .github\workflows\verifyaotcompat.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C1542297-8763-4DF4-957C-489ED771C21D}"

View File

@ -30,4 +30,18 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Target Name="SkipVSTestForInvalidTargetFramework" BeforeTargets="VSTest" Condition="'$(IsTestProject)' == 'true'">
<!-- Note: When running dotnet test from CLI with the framework parameter
errors will be generated for projects which do not implement the requested
target. In order to enable running tests for a given framework across a
solution/project with mixed targets (eg: dotnet test OpenTelemetry.sln -f
net462) we convert this into a skip message only. -->
<PropertyGroup Condition="$(TargetFrameworks.Contains($(TargetFramework))) != 'true'">
<_SkipTests>true</_SkipTests>
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<Message Importance="high" Text="Skipping test execution for '$(TargetPath)' because it does not contain the '$(TargetFramework)' target." Condition="'$(_SkipTests)' == 'true'" />
</Target>
</Project>