ci: Validate VS filter files in buiild

msbuild does not use the project in it's entirety to build the app.  This means problems can slip through, so an easy solution is just to ensure the XML is well-formed.  More sophisticated validation could be done with something like `xmllint` but seems overkill.
This commit is contained in:
Tyler Wilding 2020-09-20 13:10:14 -04:00 committed by refractionpcsx2
parent 73b02c204b
commit c4ca10258b
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,19 @@
$filterFiles = Get-ChildItem $PWD -name -recurse *.vcxproj.filters
$failed = $FALSE
foreach ($file in $filterFiles) {
# Skip 3rdparty files
if ($file -NotMatch "^3rdparty") {
$expression = "python -c `"import sys, xml.dom.minidom as d; d.parse(sys.argv[1])`" $($file)"
$expression += ';$LastExitCode'
$exitCode = Invoke-Expression $expression
if($exitCode -ne 0){
Write-Host -foregroundColor red "$($file) - Invalid VS filters file. Likely missing tags"
$failed = $TRUE
}
}
}
if ($failed) {
exit 1
}

View File

@ -87,6 +87,10 @@ jobs:
echo "##[set-output name=artifact-metadata;]${ARTIFACT_NAME}"
id: git-vars
- name: Verify VS Project Files
shell: powershell
run: .\.github\workflows\scripts\validate-vs-filters.ps1
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1.0.1
with: