diff --git a/.github/workflows/scripts/validate-vs-filters.ps1 b/.github/workflows/scripts/validate-vs-filters.ps1 new file mode 100644 index 0000000000..09e7b43ba7 --- /dev/null +++ b/.github/workflows/scripts/validate-vs-filters.ps1 @@ -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 +} \ No newline at end of file diff --git a/.github/workflows/windows-workflow.yml b/.github/workflows/windows-workflow.yml index 8f0f3946e7..b9b8e64191 100644 --- a/.github/workflows/windows-workflow.yml +++ b/.github/workflows/windows-workflow.yml @@ -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: