ADO pipeline changes for OpenSSF Best Practices (#160)

This commit is contained in:
Chuck Walbourn 2024-05-17 16:56:50 -07:00 committed by GitHub
parent 464a656562
commit 44c1c708c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 84 additions and 76 deletions

View File

@ -298,7 +298,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(ENABLE_CODE_ANALYSIS)
foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME})
target_compile_options(${t} PRIVATE /analyze)
target_compile_options(${t} PRIVATE /analyze /WX)
endforeach()
endif()

View File

@ -62,6 +62,10 @@ Sander et al. "Signal-Specialized Parametrization" Europgraphics 2002 [pdf](http
## Release Notes
FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/UVAtlas/security/advisories).
For a full change history, see [CHANGELOG.md](https://github.com/microsoft/UVAtlas/blob/main/CHANGELOG.md).
* Starting with the December 2020 release, this library makes use of typed enum bitmask flags per the recommendation of the _C++ Standard_ section *17.5.2.1.3 Bitmask types*. This is consistent with Direct3D 12's use of the ``DEFINE_ENUM_FLAG_OPERATORS`` macro. This may have *breaking change* impacts to client code:
* You cannot pass the ``0`` literal as your option flags value. Instead you must make use of the appropriate default enum value: ``UVATLAS_DEFAULT`` or ``UVATLAS_IMT_DEFAULT``.
@ -78,6 +82,8 @@ This project welcomes contributions and suggestions. Most contributions require
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
Tests for new features should also be submitted as a PR to the [Test Suite](https://github.com/walbourn/uvatlastest/wiki) repository.
## Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
@ -86,4 +92,8 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
# Credits
The UVAtlas library is the work of Xin Huang and Chuck Walbourn, with contributions from Chris Messer, Steve Schroeder, Microsoft Research China, and Team Bungie.
Thanks to Andrew Farrier and Scott Matloff for their on-going help with code reviews.

View File

@ -97,7 +97,7 @@
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

View File

@ -285,6 +285,9 @@ HRESULT CIsochartEngine::InitializeCurrentChartHeap()
}
#ifdef _OPENMP
#ifdef _MSC_VER
#pragma warning(disable : 6993)
#endif
HRESULT CIsochartEngine::ParameterizeChartsInHeapParallelized(
bool bFirstTime,
size_t MaxChartNumber)

View File

@ -12,15 +12,36 @@ schedules:
include:
- main
trigger: none
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.in
- build/*.mdb
- build/*.ps1
pr:
branches:
include:
- main
paths:
include:
- build/UVAtlas-GitHub-Dev17.yml
exclude:
- '*.md'
- LICENSE
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.in
- build/*.mdb
- build/*.ps1
drafts: false
resources:
repositories:

View File

@ -29,6 +29,7 @@ pool:
variables:
Codeql.Enabled: false
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
jobs:
@ -138,20 +139,13 @@ jobs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/uvatlastest.git Tests
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: true
- task: ChocolateyCommand@0
displayName: Install Ninja
inputs:
command: 'install'
installPackageId: 'ninja'
- task: CmdLine@2
displayName: 'Setup environment for CMake to use VS'
displayName: Setup environment for CMake to use VS
inputs:
script: |
@echo off
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
@ -213,14 +207,10 @@ jobs:
inputs:
Contents: 'out'
- task: CmdLine@2
displayName: 'Set LIB for ARM64'
displayName: Switch compiler to ARM64
inputs:
script: |
@echo off
pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
popd
call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" arm64
call "$(VC_PATH)\Auxiliary\Build\vcvarsamd64_arm64.bat"
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1

View File

@ -51,13 +51,13 @@ resources:
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
pool:
vmImage: windows-2019
variables:
Codeql.Enabled: false
GUID_FEED: $(ADOFeedGUID)
pool:
vmImage: windows-2022
jobs:
- job: DESKTOP_BUILD
displayName: 'Win32 Desktop'
@ -176,54 +176,3 @@ jobs:
msbuildArgs: /p:PreferredToolArchitecture=x64 /p:SpectreMitigation=Spectre
platform: ARM64
configuration: Release
- job: UWP_BUILD
displayName: 'Universal Windows Platform (UWP)'
timeoutInMinutes: 60
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: VSBuild@1
displayName: Build solution UVAtlas_Windows10_2022.sln 32dbg
inputs:
solution: UVAtlas_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Debug
- task: VSBuild@1
displayName: Build solution UVAtlas_Windows10_2022.sln 32rel
inputs:
solution: UVAtlas_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Release
- task: VSBuild@1
displayName: Build solution UVAtlas_Windows10_2022.sln 64dbg
inputs:
solution: UVAtlas_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Debug
- task: VSBuild@1
displayName: Build solution UVAtlas_Windows10_2022.sln 64rel
inputs:
solution: UVAtlas_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Release
- task: VSBuild@1
displayName: Build solution UVAtlas_Windows10_2022.sln arm64dbg
inputs:
solution: UVAtlas_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Debug
- task: VSBuild@1
displayName: Build solution UVAtlas_Windows10_2022.sln arm64rel
inputs:
solution: UVAtlas_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Release

View File

@ -27,6 +27,7 @@ variables:
Codeql.Enabled: true
Codeql.Language: cpp
Codeql.ExcludePathPatterns: vcpkg
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
VS_GENERATOR: 'Visual Studio 17 2022'
VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake'
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
@ -166,3 +167,37 @@ jobs:
GdnBreakPolicyMinSev: 'Error'
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection
- job: VC_PREFAST
displayName: 'Build using /analyze (PREFAST)'
workspace:
clean: all
steps:
- checkout: self
clean: true
fetchTags: false
- task: CmdLine@2
displayName: Setup environment for CMake to use VS
inputs:
script: |
call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat"
echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath%
echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin
echo ##vso[task.prependpath]%WindowsSdkBinPath%x64
echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64
echo ##vso[task.prependpath]%VCToolsInstallDir%bin\Hostx64\x64
echo ##vso[task.setvariable variable=EXTERNAL_INCLUDE;]%EXTERNAL_INCLUDE%
echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE%
echo ##vso[task.setvariable variable=LIB;]%LIB%
- task: CMake@1
displayName: CMake Config
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --preset=x64-Debug -DENABLE_CODE_ANALYSIS=ON
- task: CMake@1
displayName: CMake Build
inputs:
cwd: '$(Build.SourcesDirectory)'
cmakeArgs: --build out/build/x64-Debug