From 7360521510e7e126da333c21f5c6bf1d4d4e3f79 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 13:02:59 -0700 Subject: [PATCH 01/34] Added GitHub Actions for build and security analysis While most pipelines are hosted on ADO, this adds a GitHub build action that is available to everyone who forks the repo. Also enables the GitHub Action based CodeQL analysis. --- .github/workflows/main.yml | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..629de78b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,79 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkId=248926 + +name: 'CMake (Windows)' + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + + matrix: + os: [windows-2019, windows-2022] + build_type: [x64-Debug, x64-Release, x64-Debug-Clang, x64-Release-Clang] + arch: [amd64] + include: + - os: windows-2019 + build_type: x86-Debug + arch: amd64_x86 + - os: windows-2019 + build_type: x86-Release + arch: amd64_x86 + - os: windows-2019 + build_type: x86-Debug-Clang + arch: amd64_x86 + - os: windows-2019 + build_type: x86-Release-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Debug + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Release + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Debug-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Release-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: arm64-Debug + arch: amd64_arm64 + - os: windows-2022 + build_type: arm64-Release + arch: amd64_arm64 + - os: windows-2022 + build_type: arm64ec-Debug + arch: amd64_arm64 + - os: windows-2022 + build_type: arm64ec-Release + arch: amd64_arm64 + + steps: + - uses: actions/checkout@v4 + + - name: 'Install Ninja' + run: choco install ninja + + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - name: 'Configure CMake' + working-directory: ${{env.GITHUB_WORKSPACE}} + run: cmake --preset=${{ matrix.build_type }} + + - name: 'Build' + working-directory: ${{env.GITHUB_WORKSPACE}} + run: cmake --build out\build\${{ matrix.build_type }} From 4548ea42bb265c1602e79ddc231b705e2a3e92a1 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 13:10:38 -0700 Subject: [PATCH 02/34] Add CodeQL --- .github/workflows/codeql.yml | 51 ++++++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 13 ++++++--- 2 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..1793273f --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,51 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkId=248926 + +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '43 3 * * 3' + +jobs: + analyze: + name: Analyze (C/C++) + runs-on: windows-latest + timeout-minutes: 360 + permissions: + security-events: write + packages: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: 'Install Ninja' + run: choco install ninja + + - uses: ilammy/msvc-dev-cmd@v1 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: c-cpp + build-mode: manual + + - name: 'Configure CMake' + working-directory: ${{env.GITHUB_WORKSPACE}} + run: cmake --preset=x64-Debug + + - name: 'Build' + working-directory: ${{env.GITHUB_WORKSPACE}} + run: cmake --build out\build\x64-Debug + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:c-cpp" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 629de78b..07ccf023 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ # # http://go.microsoft.com/fwlink/?LinkId=248926 -name: 'CMake (Windows)' +name: 'CMake' on: push: @@ -59,6 +59,12 @@ jobs: - os: windows-2022 build_type: arm64ec-Release arch: amd64_arm64 + - os: ubuntu-latest + build_type: x64-Debug-Linux + arch: none + - os: ubuntu-latest + build_type: x64-Release-Linux + arch: none steps: - uses: actions/checkout@v4 @@ -66,12 +72,13 @@ jobs: - name: 'Install Ninja' run: choco install ninja - - uses: ilammy/msvc-dev-cmd@v1 + - if: matrix.arch != 'none' + uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} - name: 'Configure CMake' - working-directory: ${{env.GITHUB_WORKSPACE}} + working-directory: ${{env.GITHUB_WORKSPACE}} run: cmake --preset=${{ matrix.build_type }} - name: 'Build' From 61da47d665262ab4025604057821aebbacf66e15 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 13:35:45 -0700 Subject: [PATCH 03/34] Add paths-ignore for PR --- .github/workflows/codeql.yml | 10 ++++++++++ .github/workflows/main.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1793273f..1b6667c4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,6 +10,16 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.cmd + - build/*.json + - build/*.props + - build/*.ps1 + - build/*.targets + - build/*.yml schedule: - cron: '43 3 * * 3' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07ccf023..fe99b872 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,16 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.cmd + - build/*.json + - build/*.props + - build/*.ps1 + - build/*.targets + - build/*.yml jobs: build: From 955a0c0250a59b621c8a69593d36eeb1c71197b9 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 13:51:39 -0700 Subject: [PATCH 04/34] Update ADO triggers --- .github/workflows/main.yml | 11 ++--------- build/DirectXTex-GitHub-CMake-Dev17.yml | 2 ++ build/DirectXTex-GitHub-CMake-Xbox.yml | 2 ++ build/DirectXTex-GitHub-CMake.yml | 2 ++ build/DirectXTex-GitHub-Dev17.yml | 2 ++ build/DirectXTex-GitHub-GDK.yml | 2 ++ build/DirectXTex-GitHub-MinGW.yml | 2 ++ build/DirectXTex-GitHub-Test.yml | 3 +++ build/DirectXTex-GitHub-WSL.yml | 2 ++ build/DirectXTex-GitHub.yml | 2 ++ 10 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe99b872..dc073865 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ # # http://go.microsoft.com/fwlink/?LinkId=248926 -name: 'CMake' +name: 'CMake (Windows)' on: push: @@ -69,12 +69,6 @@ jobs: - os: windows-2022 build_type: arm64ec-Release arch: amd64_arm64 - - os: ubuntu-latest - build_type: x64-Debug-Linux - arch: none - - os: ubuntu-latest - build_type: x64-Release-Linux - arch: none steps: - uses: actions/checkout@v4 @@ -82,8 +76,7 @@ jobs: - name: 'Install Ninja' run: choco install ninja - - if: matrix.arch != 'none' - uses: ilammy/msvc-dev-cmd@v1 + - uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.arch }} diff --git a/build/DirectXTex-GitHub-CMake-Dev17.yml b/build/DirectXTex-GitHub-CMake-Dev17.yml index bd575ac8..90ea78e8 100644 --- a/build/DirectXTex-GitHub-CMake-Dev17.yml +++ b/build/DirectXTex-GitHub-CMake-Dev17.yml @@ -20,6 +20,7 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json @@ -35,6 +36,7 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json diff --git a/build/DirectXTex-GitHub-CMake-Xbox.yml b/build/DirectXTex-GitHub-CMake-Xbox.yml index d9926be2..c41f7b80 100644 --- a/build/DirectXTex-GitHub-CMake-Xbox.yml +++ b/build/DirectXTex-GitHub-CMake-Xbox.yml @@ -20,6 +20,7 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json @@ -35,6 +36,7 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json diff --git a/build/DirectXTex-GitHub-CMake.yml b/build/DirectXTex-GitHub-CMake.yml index f749b12e..a313fdc9 100644 --- a/build/DirectXTex-GitHub-CMake.yml +++ b/build/DirectXTex-GitHub-CMake.yml @@ -20,6 +20,7 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json @@ -35,6 +36,7 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json diff --git a/build/DirectXTex-GitHub-Dev17.yml b/build/DirectXTex-GitHub-Dev17.yml index f3969816..05d0c0bd 100644 --- a/build/DirectXTex-GitHub-Dev17.yml +++ b/build/DirectXTex-GitHub-Dev17.yml @@ -21,6 +21,7 @@ trigger: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd @@ -40,6 +41,7 @@ pr: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd diff --git a/build/DirectXTex-GitHub-GDK.yml b/build/DirectXTex-GitHub-GDK.yml index 28a7b9da..2456d432 100644 --- a/build/DirectXTex-GitHub-GDK.yml +++ b/build/DirectXTex-GitHub-GDK.yml @@ -23,6 +23,7 @@ trigger: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd @@ -39,6 +40,7 @@ pr: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd diff --git a/build/DirectXTex-GitHub-MinGW.yml b/build/DirectXTex-GitHub-MinGW.yml index f42d13f9..996aaa3e 100644 --- a/build/DirectXTex-GitHub-MinGW.yml +++ b/build/DirectXTex-GitHub-MinGW.yml @@ -20,6 +20,7 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json @@ -35,6 +36,7 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json diff --git a/build/DirectXTex-GitHub-Test.yml b/build/DirectXTex-GitHub-Test.yml index 6af4fab0..f08bfd34 100644 --- a/build/DirectXTex-GitHub-Test.yml +++ b/build/DirectXTex-GitHub-Test.yml @@ -21,6 +21,7 @@ trigger: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd @@ -30,6 +31,7 @@ trigger: - build/*.ps1 - build/*.targets - Auxiliary/* + pr: branches: include: @@ -39,6 +41,7 @@ pr: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd diff --git a/build/DirectXTex-GitHub-WSL.yml b/build/DirectXTex-GitHub-WSL.yml index 97fb182d..71e70695 100644 --- a/build/DirectXTex-GitHub-WSL.yml +++ b/build/DirectXTex-GitHub-WSL.yml @@ -20,6 +20,7 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json @@ -35,6 +36,7 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' - build/*.cmd - build/*.json diff --git a/build/DirectXTex-GitHub.yml b/build/DirectXTex-GitHub.yml index 617e470b..a64a1f80 100644 --- a/build/DirectXTex-GitHub.yml +++ b/build/DirectXTex-GitHub.yml @@ -21,6 +21,7 @@ trigger: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd @@ -40,6 +41,7 @@ pr: - '*.md' - LICENSE - CMake* + - '.github/*' - '.nuget/*' - build/*.cmake - build/*.cmd From 941b8e9a3f95c0c50f9d59f4b72e1c2a1a4aa748 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 19:41:46 -0700 Subject: [PATCH 05/34] Add /analyze to GitHub Actions --- .github/workflows/msvc.yml | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/msvc.yml diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml new file mode 100644 index 00000000..d23abe1e --- /dev/null +++ b/.github/workflows/msvc.yml @@ -0,0 +1,58 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkId=248926 + +name: Microsoft C++ Code Analysis + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.cmd + - build/*.json + - build/*.props + - build/*.ps1 + - build/*.targets + - build/*.yml + schedule: + - cron: '41 16 * * 1' + +permissions: + contents: read + +jobs: + analyze: + permissions: + contents: read + security-events: write + actions: read + name: Analyze + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Configure CMake + working-directory: ${{env.GITHUB_WORKSPACE}} + run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON + + - name: Initialize MSVC Code Analysis + uses: microsoft/msvc-code-analysis-action@v0.1.1 + id: run-analysis + with: + cmakeBuildDirectory: ./out + buildConfiguration: Debug + ruleset: NativeRecommendedRules.ruleset + + # Upload SARIF file to GitHub Code Scanning Alerts + - name: Upload SARIF to GitHub + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: ${{ steps.run-analysis.outputs.sarif }} From 828cb8da828f38b92e82f0906d646aeb92458a9a Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:02:00 -0700 Subject: [PATCH 06/34] Build shaders for /analyze --- .github/workflows/msvc.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index d23abe1e..8709c124 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -39,10 +39,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: amd64 + - name: Configure CMake working-directory: ${{env.GITHUB_WORKSPACE}} run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON + - name: Build Shaders + working-directory: ./DirectXTex/Shaders + run: CompileShaders.cmd + env: + CompileShadersOutput: ./out/Shaders/Compiled + - name: Initialize MSVC Code Analysis uses: microsoft/msvc-code-analysis-action@v0.1.1 id: run-analysis From b1263eb82902aa9df3d205d4ea1b533f2c4ee255 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:09:10 -0700 Subject: [PATCH 07/34] Fix script --- .github/workflows/msvc.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 8709c124..ed56ed08 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -48,8 +48,9 @@ jobs: run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON - name: Build Shaders + shell: pwsh working-directory: ./DirectXTex/Shaders - run: CompileShaders.cmd + run: ./CompileShaders.cmd env: CompileShadersOutput: ./out/Shaders/Compiled From 193a571e2c8194fdfbaa21aa833859833e5618e8 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:12:12 -0700 Subject: [PATCH 08/34] Use cmd instead of pswh --- .github/workflows/msvc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index ed56ed08..432127ec 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -48,9 +48,9 @@ jobs: run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON - name: Build Shaders - shell: pwsh + shell: cmd working-directory: ./DirectXTex/Shaders - run: ./CompileShaders.cmd + run: CompileShaders.cmd env: CompileShadersOutput: ./out/Shaders/Compiled From a1ff9ec4fb5fca9c6c2fccb8d978546cd3e25252 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:16:08 -0700 Subject: [PATCH 09/34] Fix script again --- .github/workflows/msvc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 432127ec..662d5870 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -44,7 +44,7 @@ jobs: arch: amd64 - name: Configure CMake - working-directory: ${{env.GITHUB_WORKSPACE}} + working-directory: ${{ env.GITHUB_WORKSPACE }} run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON - name: Build Shaders @@ -52,7 +52,7 @@ jobs: working-directory: ./DirectXTex/Shaders run: CompileShaders.cmd env: - CompileShadersOutput: ./out/Shaders/Compiled + CompileShadersOutput: '${{ env.GITHUB_WORKSPACE }}/out/Shaders/Compiled' - name: Initialize MSVC Code Analysis uses: microsoft/msvc-code-analysis-action@v0.1.1 From cbdca6c9a2299ec854b706e050bad8158d00b969 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:20:05 -0700 Subject: [PATCH 10/34] Another attempt --- .github/workflows/msvc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 662d5870..b7da598f 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -52,7 +52,7 @@ jobs: working-directory: ./DirectXTex/Shaders run: CompileShaders.cmd env: - CompileShadersOutput: '${{ env.GITHUB_WORKSPACE }}/out/Shaders/Compiled' + CompileShadersOutput: '$GITHUB_WORKSPACE/out/Shaders/Compiled' - name: Initialize MSVC Code Analysis uses: microsoft/msvc-code-analysis-action@v0.1.1 From bce65db46ee2ac09c570706d76fe186934c61ee2 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:24:16 -0700 Subject: [PATCH 11/34] Another attempt --- .github/workflows/msvc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index b7da598f..543c2ce1 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -52,7 +52,7 @@ jobs: working-directory: ./DirectXTex/Shaders run: CompileShaders.cmd env: - CompileShadersOutput: '$GITHUB_WORKSPACE/out/Shaders/Compiled' + CompileShadersOutput: ${{ env.GITHUB_WORKSPACE }}/out/Shaders/Compiled - name: Initialize MSVC Code Analysis uses: microsoft/msvc-code-analysis-action@v0.1.1 From 151cfd085da0f84fd52c04541fb7c8ee89f190e8 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:28:22 -0700 Subject: [PATCH 12/34] Variable syntax!@ --- .github/workflows/msvc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 543c2ce1..387ae140 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -44,7 +44,7 @@ jobs: arch: amd64 - name: Configure CMake - working-directory: ${{ env.GITHUB_WORKSPACE }} + working-directory: ${{ github.workspace }} run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON - name: Build Shaders @@ -52,7 +52,7 @@ jobs: working-directory: ./DirectXTex/Shaders run: CompileShaders.cmd env: - CompileShadersOutput: ${{ env.GITHUB_WORKSPACE }}/out/Shaders/Compiled + CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled - name: Initialize MSVC Code Analysis uses: microsoft/msvc-code-analysis-action@v0.1.1 From 312b7a6d8c51c2fd011ff0b5f55f1061d9a112c8 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:32:10 -0700 Subject: [PATCH 13/34] DDSView shaders --- .github/workflows/msvc.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 387ae140..4540c8fa 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -47,13 +47,20 @@ jobs: working-directory: ${{ github.workspace }} run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON - - name: Build Shaders + - name: 'Build Shaders (BC)' shell: cmd working-directory: ./DirectXTex/Shaders run: CompileShaders.cmd env: CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled + - name: 'Build Shaders (DDSVIEW)' + shell: cmd + working-directory: ./DDSView + run: hlsl.cmd + env: + CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled + - name: Initialize MSVC Code Analysis uses: microsoft/msvc-code-analysis-action@v0.1.1 id: run-analysis From 16056aa7eb46b9f340a1f62ddb8995cd3591eedc Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 25 Jul 2024 20:38:37 -0700 Subject: [PATCH 14/34] Fix syntax --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/main.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1b6667c4..a05a2df5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -48,11 +48,11 @@ jobs: build-mode: manual - name: 'Configure CMake' - working-directory: ${{env.GITHUB_WORKSPACE}} + working-directory: ${{ github.workspace }} run: cmake --preset=x64-Debug - name: 'Build' - working-directory: ${{env.GITHUB_WORKSPACE}} + working-directory: ${{ github.workspace }} run: cmake --build out\build\x64-Debug - name: Perform CodeQL Analysis diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc073865..900b86da 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -81,9 +81,9 @@ jobs: arch: ${{ matrix.arch }} - name: 'Configure CMake' - working-directory: ${{env.GITHUB_WORKSPACE}} + working-directory: ${{ github.workspace }} run: cmake --preset=${{ matrix.build_type }} - name: 'Build' - working-directory: ${{env.GITHUB_WORKSPACE}} + working-directory: ${{ github.workspace }} run: cmake --build out\build\${{ matrix.build_type }} From 7fa000a30f8e6d265196c605612d1ef7ef4f0e4f Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 26 Jul 2024 15:16:56 -0700 Subject: [PATCH 15/34] Code review --- CMakePresets.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 66866bd6..386c237e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -240,12 +240,12 @@ "hidden": true }, - { "name": "x64-Debug" , "description": "MSVC for x64 (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "MSVC" ] }, - { "name": "x64-Release" , "description": "MSVC for x64 (Release) with DX12", "inherits": [ "base", "x64", "Release", "MSVC" ] }, - { "name": "x86-Debug" , "description": "MSVC for x86 (Debug) with DX12", "inherits": [ "base", "x86", "Debug", "MSVC" ] }, - { "name": "x86-Release" , "description": "MSVC for x86 (Release) with DX12", "inherits": [ "base", "x86", "Release", "MSVC" ] }, - { "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) with DX12", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] }, - { "name": "arm64-Release", "description": "MSVC for ARM64 (Release) with DX12", "inherits": [ "base", "ARM64", "Release", "MSVC" ] }, + { "name": "x64-Debug" , "description": "MSVC for x64 (Debug) with DX12", "inherits": [ "base", "x64", "Debug", "MSVC" ] }, + { "name": "x64-Release" , "description": "MSVC for x64 (Release) with DX12", "inherits": [ "base", "x64", "Release", "MSVC" ] }, + { "name": "x86-Debug" , "description": "MSVC for x86 (Debug) with DX12", "inherits": [ "base", "x86", "Debug", "MSVC" ] }, + { "name": "x86-Release" , "description": "MSVC for x86 (Release) with DX12", "inherits": [ "base", "x86", "Release", "MSVC" ] }, + { "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) with DX12", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] }, + { "name": "arm64-Release" , "description": "MSVC for ARM64 (Release) with DX12", "inherits": [ "base", "ARM64", "Release", "MSVC" ] }, { "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug) with DX12", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } }, { "name": "arm64ec-Release", "description": "MSVC for ARM64EC (Release) with DX12", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } }, @@ -347,12 +347,12 @@ { "name": "x64-Fuzzing" , "description": "MSVC for x64 (Release) with ASan", "inherits": [ "base", "x64", "Release", "MSVC", "Fuzzing" ] } ], "testPresets": [ - { "name": "x64-Debug" , "configurePreset": "x64-Debug" }, - { "name": "x64-Release" , "configurePreset": "x64-Release" }, - { "name": "x86-Debug" , "configurePreset": "x86-Debug" }, - { "name": "x86-Release" , "configurePreset": "x86-Release" }, - { "name": "arm64-Debug" , "configurePreset": "arm64-Debug" }, - { "name": "arm64-Release", "configurePreset": "arm64-Release" }, + { "name": "x64-Debug" , "configurePreset": "x64-Debug" }, + { "name": "x64-Release" , "configurePreset": "x64-Release" }, + { "name": "x86-Debug" , "configurePreset": "x86-Debug" }, + { "name": "x86-Release" , "configurePreset": "x86-Release" }, + { "name": "arm64-Debug" , "configurePreset": "arm64-Debug" }, + { "name": "arm64-Release" , "configurePreset": "arm64-Release" }, { "name": "arm64ec-Debug" , "configurePreset": "arm64ec-Debug" }, { "name": "arm64ec-Release", "configurePreset": "arm64ec-Release" }, From b8fdd9bb8ea1ab5652b9af4055278c141cc78323 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 26 Jul 2024 16:15:05 -0700 Subject: [PATCH 16/34] Add MSBuild to GitHub actions --- .github/workflows/msbuild.yml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/msbuild.yml diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml new file mode 100644 index 00000000..a5d96b8b --- /dev/null +++ b/.github/workflows/msbuild.yml @@ -0,0 +1,52 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkId=248926 + +name: MSBuild + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/* + +permissions: + contents: read + +jobs: + build: + runs-on: windows-${{ matrix.vs }} + + strategy: + fail-fast: false + + matrix: + vs: [2019, 2022] + build_type: [Debug, Release] + platform: [x86, x64, ARM64] + + steps: + - uses: actions/checkout@v4 + + - name: Add MSBuild to PATH + uses: microsoft/setup-msbuild@v2 + + - if: matrix.platform != 'ARM64' + name: Build + working-directory: ${{ github.workspace }} + run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Desktop_${{ matrix.vs }}.sln + + - name: 'Build (Windows 10)' + working-directory: ${{ github.workspace }} + run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Desktop_${{ matrix.vs }}_Win10.sln + + - if: matrix.vs == '2022' + name: 'Build (UWP)' + working-directory: ${{ github.workspace }} + run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Windows10_2022.sln From e4d7fed31b8a08fa3b1dd77b7d498823541990f1 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 11:21:20 -0700 Subject: [PATCH 17/34] Build spectre configs --- .github/workflows/main.yml | 10 ++++++++++ .github/workflows/msbuild.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 900b86da..d652480a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,3 +87,13 @@ jobs: - name: 'Build' working-directory: ${{ github.workspace }} run: cmake --build out\build\${{ matrix.build_type }} + + - if: matrix.arch != 'amd64_arm64' + name: 'Configure CMake (Spectre)' + working-directory: ${{ github.workspace }} + run: cmake --preset=${{ matrix.build_type }} -DENABLE_SPECTRE_MITIGATION=ON + + - if: matrix.arch != 'amd64_arm64' + name: 'Build (Spectre)' + working-directory: ${{ github.workspace }} + run: cmake --build out\build\${{ matrix.build_type }} diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index a5d96b8b..bcd1b278 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -50,3 +50,13 @@ jobs: name: 'Build (UWP)' working-directory: ${{ github.workspace }} run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Windows10_2022.sln + + - if: matrix.platform != 'ARM64' + name: 'Build (Spectre)' + working-directory: ${{ github.workspace }} + run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXMesh_Desktop_${{ matrix.vs }}.sln + + - if: matrix.platform != 'ARM64' + name: 'Build (Spectre Windows 10)' + working-directory: ${{ github.workspace }} + run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXMesh_Desktop_${{ matrix.vs }}_Win10.sln From 8e9a69012781a83fc42d1a41f64168c81afb1d57 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 11:23:39 -0700 Subject: [PATCH 18/34] Fix build brfeak --- .github/workflows/msbuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index bcd1b278..21efa543 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -54,9 +54,9 @@ jobs: - if: matrix.platform != 'ARM64' name: 'Build (Spectre)' working-directory: ${{ github.workspace }} - run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXMesh_Desktop_${{ matrix.vs }}.sln + run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Desktop_${{ matrix.vs }}.sln - if: matrix.platform != 'ARM64' name: 'Build (Spectre Windows 10)' working-directory: ${{ github.workspace }} - run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXMesh_Desktop_${{ matrix.vs }}_Win10.sln + run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./DirectXTex_Desktop_${{ matrix.vs }}_Win10.sln From 06d030546dc27b698312ae78aaa760829d46470e Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 15:55:40 -0700 Subject: [PATCH 19/34] Update triggers for ADO to reduce overlap with GitHub Actions --- build/DirectXTex-GitHub-CMake-Dev17.yml | 2 +- build/DirectXTex-GitHub-CMake.yml | 2 +- build/DirectXTex-GitHub-Dev17.yml | 39 +++-------------------- build/DirectXTex-GitHub.yml | 41 +++---------------------- build/DirectXTex-SDL.yml | 2 +- 5 files changed, 12 insertions(+), 74 deletions(-) diff --git a/build/DirectXTex-GitHub-CMake-Dev17.yml b/build/DirectXTex-GitHub-CMake-Dev17.yml index 90ea78e8..2eff1c65 100644 --- a/build/DirectXTex-GitHub-CMake-Dev17.yml +++ b/build/DirectXTex-GitHub-CMake-Dev17.yml @@ -3,7 +3,7 @@ # # http://go.microsoft.com/fwlink/?LinkId=248926 -# Builds the library using CMake. +# Builds the library using CMake with VS Generator (GitHub Actions covers Ninja). schedules: - cron: "0 5 * * *" diff --git a/build/DirectXTex-GitHub-CMake.yml b/build/DirectXTex-GitHub-CMake.yml index a313fdc9..5784b022 100644 --- a/build/DirectXTex-GitHub-CMake.yml +++ b/build/DirectXTex-GitHub-CMake.yml @@ -3,7 +3,7 @@ # # http://go.microsoft.com/fwlink/?LinkId=248926 -# Builds the library using CMake. +# Builds the library using CMake with VS Generator (GitHub Actions covers Ninja). schedules: - cron: "0 5 * * *" diff --git a/build/DirectXTex-GitHub-Dev17.yml b/build/DirectXTex-GitHub-Dev17.yml index 05d0c0bd..5a39c051 100644 --- a/build/DirectXTex-GitHub-Dev17.yml +++ b/build/DirectXTex-GitHub-Dev17.yml @@ -12,46 +12,15 @@ schedules: include: - main -trigger: - branches: - include: - - main - paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.github/*' - - '.nuget/*' - - build/*.cmake - - build/*.cmd - - build/*.in - - build/*.json - - build/*.props - - build/*.ps1 - - build/*.targets - - Auxiliary/* - +# GitHub Actions handles MSBuild for CI/PR +trigger: none pr: branches: include: - main paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.github/*' - - '.nuget/*' - - build/*.cmake - - build/*.cmd - - build/*.in - - build/*.json - - build/*.props - - build/*.ps1 - - build/*.targets - - Auxiliary/* - drafts: false + include: + - build/DirectXTex-GitHub-Dev17.yml resources: repositories: diff --git a/build/DirectXTex-GitHub.yml b/build/DirectXTex-GitHub.yml index a64a1f80..79f4f523 100644 --- a/build/DirectXTex-GitHub.yml +++ b/build/DirectXTex-GitHub.yml @@ -6,52 +6,21 @@ # Builds the library for Windows Desktop and UWP. schedules: -- cron: "0 3 * * *" +- cron: "5 3 * * *" displayName: 'Nightly build' branches: include: - main -trigger: - branches: - include: - - main - paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.github/*' - - '.nuget/*' - - build/*.cmake - - build/*.cmd - - build/*.in - - build/*.json - - build/*.props - - build/*.ps1 - - build/*.targets - - Auxiliary/* - +# GitHub Actions handles MSBuild for CI/PR +trigger: none pr: branches: include: - main paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.github/*' - - '.nuget/*' - - build/*.cmake - - build/*.cmd - - build/*.in - - build/*.json - - build/*.props - - build/*.ps1 - - build/*.targets - - Auxiliary/* - drafts: false + include: + - build/DirectXTex-GitHub.yml resources: repositories: diff --git a/build/DirectXTex-SDL.yml b/build/DirectXTex-SDL.yml index 6b4ae3e9..2a48637f 100644 --- a/build/DirectXTex-SDL.yml +++ b/build/DirectXTex-SDL.yml @@ -12,8 +12,8 @@ schedules: include: - main +# GitHub Actions handles CodeQL and PREFAST for CI/PR trigger: none - pr: branches: include: From 589dfadaf2c98ed1f2ad4fb38c7518596412b7cf Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 16:19:40 -0700 Subject: [PATCH 20/34] Add GitHub Actiosn test --- .github/workflows/test.yml | 115 +++++++++++++++++++++++++ build/DirectXTex-GitHub-Test-Dev17.yml | 2 +- build/DirectXTex-GitHub-Test.yml | 39 +-------- 3 files changed, 120 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..d5cc83a4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,115 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkId=248926 + +name: 'CTest (Windows)' + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.cmd + - build/*.json + - build/*.props + - build/*.ps1 + - build/*.targets + - build/*.yml + +env: + DIRECTXTEX_MEDIA_PATH: ${{ github.workspace }}/Media + +jobs: + build: + runs-on: ${{ matrix.os }} + timeout-minutes: 40 + + strategy: + fail-fast: false + + matrix: + os: [windows-2019, windows-2022] + build_type: [x64-Debug, x64-Release, x64-Debug-Clang, x64-Release-Clang] + arch: [amd64] + include: + - os: windows-2019 + build_type: x86-Debug + arch: amd64_x86 + - os: windows-2019 + build_type: x86-Release + arch: amd64_x86 + - os: windows-2019 + build_type: x86-Debug-Clang + arch: amd64_x86 + - os: windows-2019 + build_type: x86-Release-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Debug + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Release + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Debug-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: x86-Release-Clang + arch: amd64_x86 + - os: windows-2022 + build_type: arm64-Debug + arch: amd64_arm64 + - os: windows-2022 + build_type: arm64-Release + arch: amd64_arm64 + - os: windows-2022 + build_type: arm64ec-Debug + arch: amd64_arm64 + - os: windows-2022 + build_type: arm64ec-Release + arch: amd64_arm64 + + steps: + - uses: actions/checkout@v4 + + - name: Clone test repository + uses: actions/checkout@v4 + with: + repository: walbourn/directxtextest + path: Tests + ref: main + + - if: matrix.build_type == 'x64-Release' + name: Clone media repository + uses: actions/checkout@v4 + with: + repository: walbourn/directxtexmedia + path: Media + ref: main + lfs: true + + - name: 'Install Ninja' + run: choco install ninja + + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - name: 'Configure CMake' + working-directory: ${{ github.workspace }} + run: cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON + + - name: 'Build' + working-directory: ${{ github.workspace }} + run: cmake --build out\build\${{ matrix.build_type }} + + - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') + timeout-minutes: 30 + name: 'Test (CPU only)' + working-directory: ${{ github.workspace }} + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats,Library diff --git a/build/DirectXTex-GitHub-Test-Dev17.yml b/build/DirectXTex-GitHub-Test-Dev17.yml index 3f8509df..e02d00f9 100644 --- a/build/DirectXTex-GitHub-Test-Dev17.yml +++ b/build/DirectXTex-GitHub-Test-Dev17.yml @@ -12,8 +12,8 @@ schedules: include: - main +# GitHub Actions handles test suite for CI/PR trigger: none - pr: branches: include: diff --git a/build/DirectXTex-GitHub-Test.yml b/build/DirectXTex-GitHub-Test.yml index f08bfd34..212322c7 100644 --- a/build/DirectXTex-GitHub-Test.yml +++ b/build/DirectXTex-GitHub-Test.yml @@ -12,46 +12,15 @@ schedules: include: - main -trigger: - branches: - include: - - main - paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.github/*' - - '.nuget/*' - - build/*.cmake - - build/*.cmd - - build/*.in - - build/*.json - - build/*.props - - build/*.ps1 - - build/*.targets - - Auxiliary/* - +# GitHub Actions handles test suite for CI/PR +trigger: none pr: branches: include: - main paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.github/*' - - '.nuget/*' - - build/*.cmake - - build/*.cmd - - build/*.in - - build/*.json - - build/*.props - - build/*.ps1 - - build/*.targets - - Auxiliary/* - drafts: false + include: + - build/DirectXTex-GitHub-Test.yml resources: repositories: From 648a0f8e5597392fccbafeb368c58fe251e79298 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 16:20:17 -0700 Subject: [PATCH 21/34] Fix expression --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5cc83a4..148be611 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,7 +84,7 @@ jobs: path: Tests ref: main - - if: matrix.build_type == 'x64-Release' + - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') name: Clone media repository uses: actions/checkout@v4 with: From 750509a275cb55ac10c1158b31b95475215d7794 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 17:06:01 -0700 Subject: [PATCH 22/34] Fixtests --- .github/workflows/test.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 148be611..8a538abc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ env: jobs: build: runs-on: ${{ matrix.os }} - timeout-minutes: 40 + timeout-minutes: 60 strategy: fail-fast: false @@ -112,4 +112,10 @@ jobs: timeout-minutes: 30 name: 'Test (CPU only)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats,Library + run: ctest --preset=${{ matrix.build_type }} -L Library + + - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') + timeout-minutes: 30 + name: 'Test (ImageFormats)' + working-directory: ${{ github.workspace }} + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats From 50555d0cd26bb5188c875ed53c8e912692d56d73 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 17:39:43 -0700 Subject: [PATCH 23/34] Tweak test --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a538abc..af3b6d6b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,10 +112,10 @@ jobs: timeout-minutes: 30 name: 'Test (CPU only)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library + run: ctest --preset=${{ matrix.build_type }} -L Library --output-on-failure - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (ImageFormats)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats --output-on-failure From 3716b6d19760e88503d073947a3b943491ef9560 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:22:39 -0700 Subject: [PATCH 24/34] Add debugging --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af3b6d6b..82fceca4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,6 +23,7 @@ on: env: DIRECTXTEX_MEDIA_PATH: ${{ github.workspace }}/Media + CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} jobs: build: @@ -112,10 +113,10 @@ jobs: timeout-minutes: 30 name: 'Test (CPU only)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library --output-on-failure + run: ctest --preset=${{ matrix.build_type }} -L Library ${{ env.CTEST_EXTRA_OPTS }} - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (ImageFormats)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats --output-on-failure + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats ${{ env.CTEST_EXTRA_OPTS }} From 2dcac35a4bfb72b2ef2841b149cdd64c5563b0ab Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:24:09 -0700 Subject: [PATCH 25/34] Fix syntax --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 82fceca4..f9e9e1af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,13 +23,15 @@ on: env: DIRECTXTEX_MEDIA_PATH: ${{ github.workspace }}/Media - CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} jobs: build: runs-on: ${{ matrix.os }} timeout-minutes: 60 + env: + CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} + strategy: fail-fast: false From 05b7af3df6461644ff5364848b4a3b35849351a4 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:25:43 -0700 Subject: [PATCH 26/34] Syntax fix --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9e9e1af..933e0d9e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,9 +29,6 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 60 - env: - CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} - strategy: fail-fast: false @@ -116,9 +113,13 @@ jobs: name: 'Test (CPU only)' working-directory: ${{ github.workspace }} run: ctest --preset=${{ matrix.build_type }} -L Library ${{ env.CTEST_EXTRA_OPTS }} - + env: + CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} + - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (ImageFormats)' working-directory: ${{ github.workspace }} run: ctest --preset=${{ matrix.build_type }} -L ImageFormats ${{ env.CTEST_EXTRA_OPTS }} + env: + CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} From 9f783b7905df9f2e8726a5a82d3455a7a59f342a Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:32:28 -0700 Subject: [PATCH 27/34] Debug option for ctest --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 933e0d9e..1632da4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,14 +112,14 @@ jobs: timeout-minutes: 30 name: 'Test (CPU only)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library ${{ env.CTEST_EXTRA_OPTS }} + run: ctest --preset=${{ matrix.build_type }} -L Library ${{ env.CTEST_DEBUG_OPTS }} env: - CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} + CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (ImageFormats)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats ${{ env.CTEST_EXTRA_OPTS }} + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats ${{ env.CTEST_DEBUG_OPTS }} env: - CTEST_EXTRA_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '--stop-on-failure' }} + CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} From a6bf70f0bba948a448bfad14e9aeddad977f8b4c Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:43:34 -0700 Subject: [PATCH 28/34] Fix variable syntax --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1632da4b..2a781844 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,7 +112,7 @@ jobs: timeout-minutes: 30 name: 'Test (CPU only)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library ${{ env.CTEST_DEBUG_OPTS }} + run: ctest --preset=${{ matrix.build_type }} -L Library $env:CTEST_DEBUG_OPTS env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} @@ -120,6 +120,6 @@ jobs: timeout-minutes: 30 name: 'Test (ImageFormats)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats ${{ env.CTEST_DEBUG_OPTS }} + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats $env:CTEST_DEBUG_OPTS env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} From 1910030a1791740c3d0a972653ed46cbf83806e0 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:44:53 -0700 Subject: [PATCH 29/34] So much syntax churn --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a781844..96c37577 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -112,7 +112,7 @@ jobs: timeout-minutes: 30 name: 'Test (CPU only)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library $env:CTEST_DEBUG_OPTS + run: ctest --preset=${{ matrix.build_type }} -L Library ${env:CTEST_DEBUG_OPTS} env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} @@ -120,6 +120,6 @@ jobs: timeout-minutes: 30 name: 'Test (ImageFormats)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats $env:CTEST_DEBUG_OPTS + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats ${env:CTEST_DEBUG_OPTS} env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} From 53942497255976de928b7ca413552f4427cd25aa Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:51:07 -0700 Subject: [PATCH 30/34] More syntax joy --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96c37577..b78be627 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -102,7 +102,7 @@ jobs: - name: 'Configure CMake' working-directory: ${{ github.workspace }} - run: cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON + run: cmake --preset=${{ matrix.build_type }} -DBUILD_TESTING=ON -DBUILD_TOOLS=OFF -DBUILD_SAMPLE=OFF - name: 'Build' working-directory: ${{ github.workspace }} @@ -112,14 +112,14 @@ jobs: timeout-minutes: 30 name: 'Test (CPU only)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library ${env:CTEST_DEBUG_OPTS} + run: ctest --preset=${{ matrix.build_type }} -L Library $env:CTEST_DEBUG_OPTS env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} - + - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (ImageFormats)' working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats ${env:CTEST_DEBUG_OPTS} + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats $env:CTEST_DEBUG_OPTS env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} From eb3cd0f8f0ee3f6c0aa0b5923d0c484e3daf0a9b Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 18:56:00 -0700 Subject: [PATCH 31/34] Struggling. --- .github/workflows/test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b78be627..ac31d45e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -111,15 +111,17 @@ jobs: - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (CPU only)' + shell: cmd working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library $env:CTEST_DEBUG_OPTS + run: ctest --preset=${{ matrix.build_type }} -L Library %CTEST_DEBUG_OPTS% env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (ImageFormats)' + shell: cmd working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats $env:CTEST_DEBUG_OPTS + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats %CTEST_DEBUG_OPTS% env: CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} From eb525644e953d4d27e73dc8ebae0c77aeeecaf5d Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 19:07:34 -0700 Subject: [PATCH 32/34] Giving up on being clever --- .github/workflows/test.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ac31d45e..61c4ae92 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -113,15 +113,10 @@ jobs: name: 'Test (CPU only)' shell: cmd working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library %CTEST_DEBUG_OPTS% - env: - CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} + run: ctest --preset=${{ matrix.build_type }} -L Library - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') timeout-minutes: 30 name: 'Test (ImageFormats)' - shell: cmd working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats %CTEST_DEBUG_OPTS% - env: - CTEST_DEBUG_OPTS: ${{ runner.debug == '1' && '--output-on-failure' || '' }} + run: ctest --preset=${{ matrix.build_type }} -L ImageFormats From 6ec3e84d9c9af5168d7592f4345d6fe2ae8784e0 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Sun, 28 Jul 2024 23:55:15 -0700 Subject: [PATCH 33/34] Remove media suage --- .github/workflows/test.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61c4ae92..dd658851 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,15 +84,6 @@ jobs: path: Tests ref: main - - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') - name: Clone media repository - uses: actions/checkout@v4 - with: - repository: walbourn/directxtexmedia - path: Media - ref: main - lfs: true - - name: 'Install Ninja' run: choco install ninja @@ -107,16 +98,3 @@ jobs: - name: 'Build' working-directory: ${{ github.workspace }} run: cmake --build out\build\${{ matrix.build_type }} - - - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') - timeout-minutes: 30 - name: 'Test (CPU only)' - shell: cmd - working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L Library - - - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') - timeout-minutes: 30 - name: 'Test (ImageFormats)' - working-directory: ${{ github.workspace }} - run: ctest --preset=${{ matrix.build_type }} -L ImageFormats From b3cc5eeda439d2856212981d916ea4c4c2589764 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 29 Jul 2024 10:08:19 -0700 Subject: [PATCH 34/34] Minor code review --- Texassemble/texassemble.cpp | 1 + Texconv/texconv.cpp | 1 + Texdiag/texdiag.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index 6a20f50c..d3cf3f21 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index 360f28bf..c8962347 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index dc9c2249..4a8d5302 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include