Simplify CI settings
This commit is contained in:
parent
66f8f16f7c
commit
d6048513db
@ -2,12 +2,6 @@
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"dotnet-reportgenerator-globaltool": {
|
||||
"version": "4.8.4",
|
||||
"commands": [
|
||||
"reportgenerator"
|
||||
]
|
||||
},
|
||||
"dotnet-format": {
|
||||
"version": "4.1.131201",
|
||||
"commands": [
|
||||
@ -15,4 +9,4 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -21,7 +21,6 @@ on:
|
||||
|
||||
env:
|
||||
IS_STABLE_BUILD: ${{ github.event.inputs.is_stable_build }}
|
||||
BUILD_NUMBER: ${{ github.run_number }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
<VersionPrefix>1.4.0</VersionPrefix>
|
||||
<VersionSuffix>beta</VersionSuffix>
|
||||
<IncludePreReleaseLabelInPackageVersion Condition="'$(IsStableBuild)' != 'true'">true</IncludePreReleaseLabelInPackageVersion>
|
||||
<BuildNumber Condition=" '$(BuildNumber)' == '' ">$([MSBuild]::ValueOrDefault($(BUILD_NUMBER), 0))</BuildNumber>
|
||||
<BuildNumber Condition=" '$(BuildNumber)' == '' ">$([MSBuild]::ValueOrDefault($(GITHUB_RUN_NUMBER), 0))</BuildNumber>
|
||||
<VersionSuffix>$(VersionSuffix).$(BuildNumber)</VersionSuffix>
|
||||
<SourceRevisionId Condition="'$(SourceRevisionId)' == ''">$(BUILD_SOURCEVERSION)</SourceRevisionId>
|
||||
<SourceRevisionId Condition="'$(SourceRevisionId)' == ''">$(GITHUB_SHA)</SourceRevisionId>
|
||||
<PackageVersion>$(VersionPrefix)</PackageVersion>
|
||||
<PackageVersion Condition="'$(IncludePreReleaseLabelInPackageVersion)' == 'true'">$(PackageVersion)-$(VersionSuffix)</PackageVersion>
|
||||
<InformationalVersion Condition="'$(SourceRevisionId)' != ''">$(PackageVersion)+$(SourceRevisionId)</InformationalVersion>
|
||||
|
||||
40
build.ps1
40
build.ps1
@ -4,9 +4,7 @@ param(
|
||||
[ValidateSet('Debug', 'Release')]
|
||||
$Configuration = $null,
|
||||
[switch]
|
||||
$ci,
|
||||
[Parameter(ValueFromRemainingArguments = $true)]
|
||||
[string[]]$MSBuildArgs
|
||||
$ci
|
||||
)
|
||||
|
||||
Set-StrictMode -Version 1
|
||||
@ -14,22 +12,10 @@ $ErrorActionPreference = 'Stop'
|
||||
|
||||
Import-Module -Force -Scope Local "$PSScriptRoot/src/common.psm1"
|
||||
|
||||
#
|
||||
# Main
|
||||
#
|
||||
|
||||
if (!$Configuration) {
|
||||
$Configuration = if ($ci) { 'Release' } else { 'Debug' }
|
||||
}
|
||||
|
||||
if ($ci) {
|
||||
$MSBuildArgs += '-p:CI=true'
|
||||
}
|
||||
|
||||
if (-not (Test-Path variable:\IsCoreCLR)) {
|
||||
$IsWindows = $true
|
||||
}
|
||||
|
||||
$artifacts = "$PSScriptRoot/artifacts/"
|
||||
|
||||
Remove-Item -Recurse $artifacts -ErrorAction Ignore
|
||||
@ -42,26 +28,10 @@ if ($ci) {
|
||||
}
|
||||
|
||||
exec dotnet tool run dotnet-format -- -v detailed @formatArgs
|
||||
|
||||
exec dotnet build --configuration $Configuration '-warnaserror:CS1591' @MSBuildArgs
|
||||
exec dotnet pack --no-restore --no-build --configuration $Configuration -o $artifacts @MSBuildArgs
|
||||
|
||||
[string[]] $testArgs=@()
|
||||
if ($env:TF_BUILD) {
|
||||
$testArgs += '--logger', 'trx'
|
||||
}
|
||||
|
||||
exec dotnet test --no-restore --no-build --configuration $Configuration '-clp:Summary' `
|
||||
exec dotnet build --configuration $Configuration '-warnaserror:CS1591'
|
||||
exec dotnet pack --no-restore --no-build --configuration $Configuration -o $artifacts
|
||||
exec dotnet test --no-restore --no-build --configuration $Configuration `
|
||||
"$PSScriptRoot/test/Plugins.Tests/McMaster.NETCore.Plugins.Tests.csproj" `
|
||||
--collect:"XPlat Code Coverage" `
|
||||
@testArgs `
|
||||
@MSBuildArgs
|
||||
|
||||
if ($ci) {
|
||||
exec dotnet tool run reportgenerator `
|
||||
"-reports:$PSScriptRoot/**/coverage.cobertura.xml" `
|
||||
"-targetdir:$PSScriptRoot/coverlet/reports" `
|
||||
"-reporttypes:Cobertura"
|
||||
}
|
||||
--collect:"XPlat Code Coverage"
|
||||
|
||||
write-host -f green 'BUILD SUCCEEDED'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user