mirror of
https://github.com/CommunityToolkit/dotnet.git
synced 2026-10-18 21:21:47 +08:00
74 lines
1.9 KiB
YAML
74 lines
1.9 KiB
YAML
trigger:
|
|
- main
|
|
- dev/*
|
|
- rel/*
|
|
|
|
pr:
|
|
- main
|
|
- dev/*
|
|
- rel/*
|
|
|
|
pool:
|
|
vmImage: windows-latest
|
|
|
|
variables:
|
|
Build.Configuration: Release
|
|
|
|
jobs:
|
|
- job: BuildBits
|
|
displayName: Build and Test solution
|
|
timeoutInMinutes: 60
|
|
steps:
|
|
|
|
# Set Build Version
|
|
- script: nbgv cloud
|
|
displayName: Set NBGV version
|
|
|
|
# Restore solution
|
|
- script: dotnet restore -p:Configuration=$(Build.Configuration)
|
|
displayName: Restore solution
|
|
|
|
# Build solution
|
|
- script: dotnet build --no-restore -c $(Build.Configuration)
|
|
displayName: Build solution
|
|
|
|
# Test solution #
|
|
|
|
# Run .NET 7 unit tests
|
|
- script: dotnet test --no-build -c $(Build.Configuration) -f net7.0 -l "trx;LogFileName=VSTestResults_net7.0.trx"
|
|
displayName: Run .NET 7 unit tests
|
|
|
|
# Run .NET 6 unit tests
|
|
- script: dotnet test --no-build -c $(Build.Configuration) -f net6.0 -l "trx;LogFileName=VSTestResults_net6.0.trx"
|
|
displayName: Run .NET 6 unit tests
|
|
|
|
# Run .NET Framework 4.7.2 unit tests
|
|
- script: dotnet test --no-build -c $(Build.Configuration) -f net472 -l "trx;LogFileName=VSTestResults_net472.trx"
|
|
displayName: Run .NET Framework 4.7.2 unit tests
|
|
|
|
# Publish test results
|
|
- task: PublishTestResults@2
|
|
displayName: Publish test results
|
|
inputs:
|
|
testResultsFormat: VSTest
|
|
testResultsFiles: '**/TestResults/VSTestResults*.trx'
|
|
condition: always()
|
|
|
|
# Pack solution
|
|
- script: dotnet pack --no-build -c $(Build.Configuration)
|
|
displayName: Pack solution
|
|
|
|
# Sign packages
|
|
- pwsh: build/Sign-Package.ps1
|
|
displayName: Authenticode sign packages
|
|
env:
|
|
SignClientUser: $(SignClientUser)
|
|
SignClientSecret: $(SignClientSecret)
|
|
ArtifactDirectory: bin/nupkg
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), ne(variables['SignClientUser'], ''), ne(variables['SignClientSecret'], ''))
|
|
|
|
# Publish build artifacts
|
|
- publish: bin/nupkg
|
|
artifact: Packages
|
|
displayName: Publish package artifacts
|