Run some verification checks on PRs and add early errors for bad PackageArtifact config (#771)
This commit is contained in:
parent
952dbae68d
commit
5214c9382b
|
|
@ -0,0 +1,21 @@
|
|||
init:
|
||||
- git config --global core.autocrlf true
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^release\/.*/
|
||||
- dev
|
||||
- /^(.*\/)?ci-.*$/
|
||||
install:
|
||||
# Set depth to 50 because the commit we need may not be at the tip of the branch configured in .gitmodules
|
||||
- git submodule update --init --depth=50 --recursive
|
||||
build_script:
|
||||
- ps: .\run.ps1 default-build /t:ComputeGraph
|
||||
clone_depth: 1
|
||||
environment:
|
||||
global:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
test: off
|
||||
deploy: off
|
||||
os: Visual Studio 2017
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
language: csharp
|
||||
sudo: false
|
||||
dist: trusty
|
||||
env:
|
||||
global:
|
||||
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
mono: none
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libunwind8
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /^release\/.*/
|
||||
- dev
|
||||
- /^(.*\/)?ci-.*$/
|
||||
script:
|
||||
- ./build.sh -t:ComputeGraph
|
||||
|
|
@ -154,6 +154,14 @@
|
|||
DependsOnTargets="_PrepareRepositories;GeneratePropsFiles;ComputeGraph;_BuildRepositories" />
|
||||
|
||||
<Target Name="ComputeGraph" DependsOnTargets="ResolveRepoInfo;GeneratePropsFiles">
|
||||
<ItemGroup>
|
||||
<_UndeclaredPackageArtifact Include="%(ArtifactInfo.PackageId)" Condition="'%(ArtifactInfo.ArtifactType)' == 'NuGetPackage'" />
|
||||
<_UndeclaredPackageArtifact Remove="@(PackageArtifact)" />
|
||||
</ItemGroup>
|
||||
|
||||
<Error Text="Undeclared package artifacts. Add these to artifacts.props:%0A - @(_UndeclaredPackageArtifact, '%0A - ')"
|
||||
Condition=" @(_UndeclaredPackageArtifact->Count()) != 0 " />
|
||||
|
||||
<RepoTasks.AnalyzeBuildGraph
|
||||
Solutions="@(Solution)"
|
||||
Artifacts="@(ArtifactInfo)"
|
||||
|
|
@ -179,8 +187,17 @@
|
|||
</Target>
|
||||
|
||||
<Target Name="VerifyPackageArtifactConfig">
|
||||
<Error Text="Invalid configuration of %(PackageArtifact.Identity). PackageArtifact must have the 'Category' metadata."
|
||||
Condition="'%(PackageArtifact.Category)' == '' " />
|
||||
|
||||
<Error Text="Invalid configuration of %(PackageArtifact.Identity). Packages marked as Metapackage='true' must be Category='ship'."
|
||||
Condition="'%(PackageArtifact.Category)' != 'ship' AND '%(PackageArtifact.Metapackage)' == 'true' " />
|
||||
|
||||
<Error Text="Invalid configuration of %(PackageArtifact.Identity). Packages marked as LZMA='true' must be Category='ship'."
|
||||
Condition="'%(PackageArtifact.Category)' != 'ship' AND '%(PackageArtifact.LZMA)' == 'true' " />
|
||||
|
||||
<Error Text="Invalid configuration of %(PackageArtifact.Identity). Packages marked as LZMATools='true' must be Category='ship'."
|
||||
Condition="'%(PackageArtifact.Category)' != 'ship' AND '%(PackageArtifact.LZMATools)' == 'true' " />
|
||||
</Target>
|
||||
|
||||
<Target Name="VerifyCoherentVersions" DependsOnTargets="ResolveRepoInfo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue