Run some verification checks on PRs and add early errors for bad PackageArtifact config (#771)

This commit is contained in:
Nate McMaster 2018-01-11 10:30:57 -08:00 committed by GitHub
parent 952dbae68d
commit 5214c9382b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 58 additions and 0 deletions

21
.appveyor.yml Normal file
View File

@ -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

20
.travis.yml Normal file
View File

@ -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

View File

@ -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">