ADO pipeline changes for OpenSSF Best Practices (#232)

This commit is contained in:
Chuck Walbourn 2024-05-17 19:11:34 -07:00 коммит произвёл GitHub
Родитель 459e11565d
Коммит f51741ff06
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
11 изменённых файлов: 1667 добавлений и 157 удалений

Просмотреть файл

@ -1483,7 +1483,7 @@ X3DAUDIO_HANDLE& AudioEngine::Get3DHandle() const noexcept
#ifdef _MSC_VER
#pragma comment(lib,"runtimeobject.lib")
#pragma warning(push)
#pragma warning(disable: 4471 5204 5256)
#pragma warning(disable: 4471 5204 5256 6553)
#endif
#ifdef __clang__
#pragma clang diagnostic ignored "-Wnonportable-system-include-path"

Просмотреть файл

@ -420,7 +420,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if(ENABLE_CODE_ANALYSIS)
target_compile_options(${PROJECT_NAME} PRIVATE /analyze)
target_compile_options(${PROJECT_NAME} PRIVATE /analyze /WX)
endif()
if(ENABLE_SPECTRE_MITIGATION

Просмотреть файл

@ -204,7 +204,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>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>

Просмотреть файл

@ -84,6 +84,10 @@ For the latest version of DirectXTK12, bug reports, etc. please visit the projec
## Release Notes
FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/DirectXTK12/security/advisories).
For a full change history, see [CHANGELOG.md](https://github.com/microsoft/DirectXTK12/blob/main/CHANGELOG.md).
* Starting with the February 2023 release, the Mouse class implementation of relative mouse movement was updated to accumulate changes between calls to ``GetState``. By default, each time you call ``GetState`` the deltas are reset which works for scenarios where you use relative movement but only call the method once per frame. If you call it more than once per frame, then add an explicit call to ``EndOfInputFrame`` to use an explicit reset model instead.
* As of the September 2022 release, the library makes use of C++11 inline namespaces for differing types that have the same names in the DirectX 11 and DirectX 12 version of the *DirectX Tool Kit*. This provides a link-unique name such as ``DirectX::DX12::SpriteBatch`` that will appear in linker output messages. In most use cases, however, there is no need to add explicit ``DX12`` namespace resolution in client code.
@ -114,6 +118,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/directxtk12test/wiki) repository.
## Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more informatsion 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.

Просмотреть файл

@ -422,7 +422,7 @@ bool GamePad::GetDevice(int player, _Outptr_ IGameInputDevice * *device) noexcep
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4471 5204 5256)
#pragma warning(disable : 4471 5204 5256 6553)
#endif
#include <windows.gaming.input.h>
#ifdef _MSC_VER

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -238,7 +238,7 @@
#endif
#pragma warning(push)
#pragma warning(disable : 4467 4986 5038 5204 5220)
#pragma warning(disable : 4467 4986 5038 5204 5220 6101)
#ifdef __MINGW32__
#include <wrl/client.h>
#else

Просмотреть файл

@ -12,22 +12,50 @@ schedules:
include:
- main
trigger: none
trigger:
branches:
include:
- main
paths:
exclude:
- '*.md'
- LICENSE
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
pr:
branches:
include:
- main
paths:
include:
- build/DirectXTK12-GitHub-Dev17.yml
exclude:
- '*.md'
- LICENSE
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.xvd
drafts: false
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
trigger: none
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

Просмотреть файл

@ -36,6 +36,7 @@ pool:
variables:
Codeql.Enabled: false
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
GITHUB_PAT: $(GITHUBPUBLICTOKEN)
GUID_FEED: $(ADOFeedGUID)
@ -44,6 +45,8 @@ jobs:
displayName: 'Win32 Desktop for x64/x86'
timeoutInMinutes: 60
cancelTimeoutInMinutes: 1
workspace:
clean: all
steps:
- checkout: self
clean: true
@ -212,6 +215,8 @@ jobs:
- job: CMAKE_BUILD
displayName: 'CMake BUILD_TESTING=ON'
timeoutInMinutes: 60
workspace:
clean: all
steps:
- checkout: self
clean: true
@ -229,20 +234,13 @@ jobs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtk12test.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
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
@ -304,14 +302,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

Просмотреть файл

@ -63,7 +63,7 @@ variables:
Codeql.Enabled: false
pool:
vmImage: windows-2022
vmImage: windows-2019
jobs:
- job: DESKTOP_BUILD
@ -116,54 +116,3 @@ jobs:
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Release
- job: UWP_BUILD
displayName: 'Universal Windows Platform (UWP)'
timeoutInMinutes: 120
cancelTimeoutInMinutes: 1
steps:
- checkout: self
clean: true
fetchTags: false
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 32dbg
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Debug
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 32rel
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x86
configuration: Release
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 64dbg
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Debug
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln 64rel
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: x64
configuration: Release
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln arm64dbg
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Debug
- task: VSBuild@1
displayName: Build solution DirectXTK_Windows10_2022.sln arm64rel
inputs:
solution: DirectXTK_Windows10_2022.sln
msbuildArgs: /p:PreferredToolArchitecture=x64
platform: ARM64
configuration: Release

Просмотреть файл

@ -26,6 +26,7 @@ name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
variables:
Codeql.Enabled: true
Codeql.Language: cpp
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
VS_GENERATOR: 'Visual Studio 17 2022'
pool:
@ -98,3 +99,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