ADO pipeline changes for OpenSSF Best Practices (#455)

This commit is contained in:
Chuck Walbourn 2024-05-17 16:57:34 -07:00 коммит произвёл GitHub
Родитель 5094d2665f
Коммит 03afb33301
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
12 изменённых файлов: 105 добавлений и 136 удалений

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

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

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

@ -419,7 +419,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()

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

@ -201,7 +201,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>

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

@ -74,6 +74,10 @@ For the latest version of DirectXTK, bug reports, etc. please visit the project
## Release Notes
FOR SECURITY ADVISORIES, see [GitHub](https://github.com/microsoft/DirectXTK/security/advisories).
For a full change history, see [CHANGELOG.md](https://github.com/microsoft/DirectXTK/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::DX11::SpriteBatch`` that will appear in linker output messages. In most use cases, however, there is no need to add explicit ``DX11`` namespace resolution in client code.
@ -108,6 +112,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/directxtktest/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.

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

@ -895,22 +895,13 @@ namespace
if (texture || textureView)
{
#if defined(_XBOX_ONE) && defined(_TITLE)
const wchar_t* pstrName = wcsrchr(fileName, '\\');
if (!pstrName)
{
pstrName = fileName;
}
else
{
pstrName++;
}
if (texture && *texture)
{
(*texture)->SetName(pstrName);
(*texture)->SetName(fileName);
}
if (textureView && *textureView)
{
(*textureView)->SetName(pstrName);
(*textureView)->SetName(fileName);
}
#else
CHAR strFileA[MAX_PATH];
@ -925,29 +916,19 @@ namespace
);
if (result > 0)
{
const char* pstrName = strrchr(strFileA, '\\');
if (!pstrName)
{
pstrName = strFileA;
}
else
{
pstrName++;
}
if (texture && *texture)
{
(*texture)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
if (textureView && *textureView)
{
(*textureView)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
}

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

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

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

@ -754,22 +754,13 @@ namespace
if (texture || textureView)
{
#if defined(_XBOX_ONE) && defined(_TITLE)
const wchar_t* pstrName = wcsrchr(fileName, '\\');
if (!pstrName)
{
pstrName = fileName;
}
else
{
pstrName++;
}
if (texture && *texture)
{
(*texture)->SetName(pstrName);
(*texture)->SetName(fileName);
}
if (textureView && *textureView)
{
(*textureView)->SetName(pstrName);
(*textureView)->SetName(fileName);
}
#else
CHAR strFileA[MAX_PATH];
@ -784,29 +775,19 @@ namespace
);
if (result > 0)
{
const char* pstrName = strrchr(strFileA, '\\');
if (!pstrName)
{
pstrName = strFileA;
}
else
{
pstrName++;
}
if (texture && *texture)
{
(*texture)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
if (textureView && *textureView)
{
(*textureView)->SetPrivateData(WKPDID_D3DDebugObjectName,
static_cast<UINT>(strnlen_s(pstrName, MAX_PATH)),
pstrName
static_cast<UINT>(result),
strFileA
);
}
}

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

@ -167,7 +167,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,48 @@ 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
pr:
branches:
include:
- main
paths:
include:
- build/DirectXTK-GitHub-Dev17.yml
exclude:
- '*.md'
- LICENSE
- CMake*
- '.nuget/*'
- build/*.cmake
- build/*.cmd
- build/*.in
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
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)
@ -255,20 +256,13 @@ jobs:
script: git clone --quiet --no-tags https://%GITHUB_PAT%@github.com/walbourn/directxtktest.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
@ -330,14 +324,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

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

@ -57,13 +57,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'
@ -199,60 +199,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: CmdLine@2
displayName: 'Reclaim diskspace'
inputs:
script: del *.pch /s
workingDirectory: $(Build.SourcesDirectory)
failOnStderr: false
- 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

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

@ -13,7 +13,14 @@ schedules:
- main
trigger: none
pr: none
pr:
branches:
include:
- main
paths:
include:
- build/DirectXTK-SDL.yml
resources:
repositories:
@ -27,6 +34,7 @@ variables:
Codeql.Enabled: true
Codeql.Language: cpp,csharp
Codeql.ExcludePathPatterns: packages
VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC'
VS_GENERATOR: 'Visual Studio 17 2022'
URL_FEED: $(ADOFeedURL)
skipNugetSecurityAnalysis: true # We explicitly call this task so we don't need it to be auto-injected
@ -138,3 +146,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