From 460d3c1ff697cfce039df7ac31c26dec479a7866 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 29 Jul 2024 20:11:53 -0700 Subject: [PATCH] Added GitHub Actions for build and security analysis (#164) --- .github/workflows/codeql.yml | 59 +++++++++++ .github/workflows/main.yml | 97 +++++++++++++++++++ .github/workflows/msbuild.yml | 57 +++++++++++ .github/workflows/msvc.yml | 56 +++++++++++ .github/workflows/test.yml | 140 +++++++++++++++++++++++++++ .gitignore | 1 + CMakePresets.json | 39 +++++--- UVAtlasTool/UVAtlas.cpp | 31 +++--- build/UVAtlas-GitHub-CMake-Dev17.yml | 8 +- build/UVAtlas-GitHub-CMake.yml | 8 +- build/UVAtlas-GitHub-Dev17.yml | 29 +----- build/UVAtlas-GitHub-MinGW.yml | 6 ++ build/UVAtlas-GitHub-Test-Dev17.yml | 2 +- build/UVAtlas-GitHub-Test.yml | 29 +----- build/UVAtlas-GitHub-WSL-11.yml | 12 ++- build/UVAtlas-GitHub-WSL.yml | 15 ++- build/UVAtlas-GitHub.yml | 31 +----- build/UVAtlas-SDL.yml | 9 +- build/vcpkg.json | 11 +++ 19 files changed, 527 insertions(+), 113 deletions(-) create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/msbuild.yml create mode 100644 .github/workflows/msvc.yml create mode 100644 .github/workflows/test.yml create mode 100644 build/vcpkg.json diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..0d17ff8 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,59 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkID=512686 + +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.mdb + - build/*.props + - build/*.ps1 + - build/*.yml + schedule: + - cron: '19 19 * * 0' + +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: ${{ github.workspace }} + run: cmake --preset=x64-Debug + + - name: 'Build' + working-directory: ${{ 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 new file mode 100644 index 0000000..66c1946 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,97 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkID=512686 + +name: 'CMake (Windows)' + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.mdb + - build/*.props + - build/*.ps1 + - build/*.yml + +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: ${{ github.workspace }} + run: cmake --preset=${{ matrix.build_type }} + + - 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 new file mode 100644 index 0000000..9a1a3e3 --- /dev/null +++ b/.github/workflows/msbuild.yml @@ -0,0 +1,57 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkID=512686 + +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: Restore NuGet packages + working-directory: ${{ github.workspace }} + run: nuget restore ./UVAtlas_${{ matrix.vs }}_Win10.sln + + - name: 'Build' + working-directory: ${{ github.workspace }} + run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./UVAtlas_${{ 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 }} ./UVAtlas_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 }} ./UVAtlas_${{ matrix.vs }}_Win10.sln diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml new file mode 100644 index 0000000..afb440f --- /dev/null +++ b/.github/workflows/msvc.yml @@ -0,0 +1,56 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkID=512686 + +name: Microsoft C++ Code Analysis + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.mdb + - build/*.props + - build/*.ps1 + - build/*.yml + schedule: + - cron: '31 18 * * 5' + +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: ${{ 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 }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..33e33dd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,140 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# http://go.microsoft.com/fwlink/?LinkID=512686 + +name: 'CTest (Windows)' + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + paths-ignore: + - '*.md' + - LICENSE + - '.nuget/*' + - build/*.mdb + - build/*.props + - build/*.ps1 + - build/*.yml + +env: + DIRECTXMESH_MEDIA_PATH: ${{ github.workspace }}/Media + DIRECTXTEX_MEDIA_PATH: ${{ github.workspace }}/Media + +jobs: + build: + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + + 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 + exclude: + # Exclude failing case due to linker issue. + - os: windows-2022 + build_type: x64-Debug-Clang + + steps: + - uses: actions/checkout@v4 + + - name: Clone test repository + uses: actions/checkout@v4 + with: + repository: walbourn/uvatlastest + path: Tests + ref: main + + - name: 'Install Ninja' + run: choco install ninja + + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - name: 'Set triplet' + shell: pwsh + run: | + if ("${{ matrix.arch }}" -eq "amd64") + { + echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $env:GITHUB_ENV + } + elseif ("${{ matrix.arch }}" -eq "amd64_x86") + { + echo "VCPKG_DEFAULT_TRIPLET=x86-windows" >> $env:GITHUB_ENV + } + elseif ("${{ matrix.arch }}" -eq "amd64_arm64") + { + if ("${{ matrix.build_type }}" -match "^arm64ec") + { + echo "VCPKG_DEFAULT_TRIPLET=arm64ec-windows" >> $env:GITHUB_ENV + } + else + { + echo "VCPKG_DEFAULT_TRIPLET=arm64-windows" >> $env:GITHUB_ENV + } + } + else + { + echo "::error Unknown architecture/build-type triplet mapping" + } + + - uses: lukka/run-vcpkg@v11 + with: + runVcpkgInstall: true + vcpkgJsonGlob: '**/build/vcpkg.json' + vcpkgGitCommitId: 'cacf5994341f27e9a14a7b8724b0634b138ecb30' + + - name: 'Configure CMake' + working-directory: ${{ github.workspace }} + shell: pwsh + run: > + cmake --preset=${{ matrix.build_type }} -DBUILD_TOOLS=ON -DBUILD_TESTING=ON + -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_MANIFEST_DIR="${{ github.workspace }}/build" + -DVCPKG_TARGET_TRIPLET="${env:VCPKG_DEFAULT_TRIPLET}" + + - name: 'Build' + working-directory: ${{ github.workspace }} + run: cmake --build out\build\${{ matrix.build_type }} diff --git a/.gitignore b/.gitignore index 22db94d..7e8dc20 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ packages /wiki /out /CMakeUserPresets.json +/build/vcpkg_installed diff --git a/CMakePresets.json b/CMakePresets.json index 0a4f655..4101284 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -38,6 +38,15 @@ "cacheVariables": { "DIRECTX_ARCH": "arm64" }, "hidden": true }, + { + "name": "ARM64EC", + "architecture": { + "value": "arm64ec", + "strategy": "external" + }, + "cacheVariables": { "DIRECTX_ARCH": "arm64ec" }, + "hidden": true + }, { "name": "Debug", @@ -174,12 +183,14 @@ } }, - { "name": "x64-Debug" , "description": "MSVC for x64 (Debug) Library only", "inherits": [ "base", "x64", "Debug", "MSVC" ] }, - { "name": "x64-Release" , "description": "MSVC for x64 (Release) Library only", "inherits": [ "base", "x64", "Release", "MSVC" ] }, - { "name": "x86-Debug" , "description": "MSVC for x86 (Debug) Library only", "inherits": [ "base", "x86", "Debug", "MSVC" ] }, - { "name": "x86-Release" , "description": "MSVC for x86 (Release) Library only", "inherits": [ "base", "x86", "Release", "MSVC" ] }, - { "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) Library only", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] }, - { "name": "arm64-Release", "description": "MSVC for ARM64 (Release) Library only", "inherits": [ "base", "ARM64", "Release", "MSVC" ] }, + { "name": "x64-Debug" , "description": "MSVC for x64 (Debug) Library only", "inherits": [ "base", "x64", "Debug", "MSVC" ] }, + { "name": "x64-Release" , "description": "MSVC for x64 (Release) Library only", "inherits": [ "base", "x64", "Release", "MSVC" ] }, + { "name": "x86-Debug" , "description": "MSVC for x86 (Debug) Library only", "inherits": [ "base", "x86", "Debug", "MSVC" ] }, + { "name": "x86-Release" , "description": "MSVC for x86 (Release) Library only", "inherits": [ "base", "x86", "Release", "MSVC" ] }, + { "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) Library only", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] }, + { "name": "arm64-Release" , "description": "MSVC for ARM64 (Release) Library only", "inherits": [ "base", "ARM64", "Release", "MSVC" ] }, + { "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug) Library only", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } }, + { "name": "arm64ec-Release", "description": "MSVC for ARM64EC (Release) Library only", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } }, { "name": "x64-Debug-UWP" , "description": "MSVC for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "MSVC", "UWP" ] }, { "name": "x64-Release-UWP" , "description": "MSVC for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "MSVC", "UWP" ] }, @@ -194,12 +205,14 @@ { "name": "x64-Debug-XboxOne" , "description": "MSVC for x64 (Debug) for Xbox One", "inherits": [ "base", "x64", "Debug", "MSVC", "XboxOne" ] }, { "name": "x64-Release-XboxOne" , "description": "MSVC for x64 (Release) for Xbox One", "inherits": [ "base", "x64", "Release", "MSVC", "XboxOne" ] }, - { "name": "x64-Debug-VCPKG" , "description": "MSVC for x64 (Debug) uvatlastool", "inherits": [ "base", "x64", "Debug", "VCPKG", "MSVC", "Tools" ] }, - { "name": "x64-Release-VCPKG" , "description": "MSVC for x64 (Release) uvatlastool", "inherits": [ "base", "x64", "Release", "VCPKG", "MSVC", "Tools" ] }, - { "name": "x86-Debug-VCPKG" , "description": "MSVC for x86 (Debug) uvatlastool", "inherits": [ "base", "x86", "Debug", "VCPKG", "MSVC", "Tools" ] }, - { "name": "x86-Release-VCPKG" , "description": "MSVC for x86 (Release) uvatlastool", "inherits": [ "base", "x86", "Release", "VCPKG", "MSVC", "Tools" ] }, - { "name": "arm64-Debug-VCPKG" , "description": "MSVC for ARM64 (Debug) uvatlastool", "inherits": [ "base", "ARM64", "Debug", "VCPKG", "MSVC", "Tools" ] }, - { "name": "arm64-Release-VCPKG", "description": "MSVC for ARM64 (Release) uvatlastool", "inherits": [ "base", "ARM64", "Release", "VCPKG", "MSVC", "Tools" ] }, + { "name": "x64-Debug-VCPKG" , "description": "MSVC for x64 (Debug) uvatlastool", "inherits": [ "base", "x64", "Debug", "VCPKG", "MSVC", "Tools" ] }, + { "name": "x64-Release-VCPKG" , "description": "MSVC for x64 (Release) uvatlastool", "inherits": [ "base", "x64", "Release", "VCPKG", "MSVC", "Tools" ] }, + { "name": "x86-Debug-VCPKG" , "description": "MSVC for x86 (Debug) uvatlastool", "inherits": [ "base", "x86", "Debug", "VCPKG", "MSVC", "Tools" ] }, + { "name": "x86-Release-VCPKG" , "description": "MSVC for x86 (Release) uvatlastool", "inherits": [ "base", "x86", "Release", "VCPKG", "MSVC", "Tools" ] }, + { "name": "arm64-Debug-VCPKG" , "description": "MSVC for ARM64 (Debug) uvatlastool", "inherits": [ "base", "ARM64", "Debug", "VCPKG", "MSVC", "Tools" ] }, + { "name": "arm64-Release-VCPKG" , "description": "MSVC for ARM64 (Release) uvatlastool", "inherits": [ "base", "ARM64", "Release", "VCPKG", "MSVC", "Tools" ] }, + { "name": "arm64ec-Debug-VCPKG" , "description": "MSVC for ARM64EC (Debug) uvatlastool", "inherits": [ "base", "ARM64EC", "Debug", "VCPKG", "MSVC", "Tools" ], "environment": { "CXXFLAGS": "/arm64EC" }, "cacheVariables": { "VCPKG_TARGET_TRIPLET": "arm64ec-windows" } }, + { "name": "arm64ec-Release-VCPKG", "description": "MSVC for ARM64EC (Release) uvatlastool", "inherits": [ "base", "ARM64EC", "Release", "VCPKG", "MSVC", "Tools" ], "environment": { "CXXFLAGS": "/arm64EC" }, "cacheVariables": { "VCPKG_TARGET_TRIPLET": "arm64ec-windows" } }, { "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug) Library only", "inherits": [ "base", "x64", "Debug", "Clang" ] }, { "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release) Library only", "inherits": [ "base", "x64", "Release", "Clang" ] }, @@ -251,6 +264,8 @@ { "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" }, { "name": "x64-Debug-Clang" , "configurePreset": "x64-Debug-Clang" }, { "name": "x64-Release-Clang" , "configurePreset": "x64-Release-Clang" }, diff --git a/UVAtlasTool/UVAtlas.cpp b/UVAtlasTool/UVAtlas.cpp index 59fe760..060011d 100644 --- a/UVAtlasTool/UVAtlas.cpp +++ b/UVAtlasTool/UVAtlas.cpp @@ -726,6 +726,9 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) pValue = argv[iArg]; } break; + + default: + break; } switch (dwOption) @@ -975,20 +978,23 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) break; case OPT_FILELIST: - { - std::filesystem::path path(pValue); - std::wifstream inFile(path.make_preferred().c_str()); - if (!inFile) { - wprintf(L"Error opening -flist file %ls\n", pValue); - return 1; + std::filesystem::path path(pValue); + std::wifstream inFile(path.make_preferred().c_str()); + if (!inFile) + { + wprintf(L"Error opening -flist file %ls\n", pValue); + return 1; + } + + inFile.imbue(std::locale::classic()); + + ProcessFileList(inFile, conversion); } + break; - inFile.imbue(std::locale::classic()); - - ProcessFileList(inFile, conversion); - } - break; + default: + break; } } else if (wcspbrk(pArg, L"?*") != nullptr) @@ -1348,6 +1354,9 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) signalStride = sizeof(XMFLOAT2); } break; + + default: + break; } if (!pSignal) diff --git a/build/UVAtlas-GitHub-CMake-Dev17.yml b/build/UVAtlas-GitHub-CMake-Dev17.yml index 7cf40b5..135d2aa 100644 --- a/build/UVAtlas-GitHub-CMake-Dev17.yml +++ b/build/UVAtlas-GitHub-CMake-Dev17.yml @@ -3,7 +3,7 @@ # # http://go.microsoft.com/fwlink/?LinkID=512686 -# Builds the library using CMake. +# Builds the library using CMake with VS Generator (GitHub Actions covers Ninja). schedules: - cron: "45 4 * * *" @@ -20,7 +20,10 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.json + - build/*.props - build/*.mdb - build/*.ps1 @@ -32,7 +35,10 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.json + - build/*.props - build/*.mdb - build/*.ps1 drafts: false diff --git a/build/UVAtlas-GitHub-CMake.yml b/build/UVAtlas-GitHub-CMake.yml index abc162c..d2d4a9f 100644 --- a/build/UVAtlas-GitHub-CMake.yml +++ b/build/UVAtlas-GitHub-CMake.yml @@ -3,7 +3,7 @@ # # http://go.microsoft.com/fwlink/?LinkID=512686 -# Builds the library using CMake. +# Builds the library using CMake with VS Generator (GitHub Actions covers Ninja). schedules: - cron: "30 4 * * *" @@ -20,7 +20,10 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.json + - build/*.props - build/*.mdb - build/*.ps1 @@ -32,7 +35,10 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.json + - build/*.props - build/*.mdb - build/*.ps1 drafts: false diff --git a/build/UVAtlas-GitHub-Dev17.yml b/build/UVAtlas-GitHub-Dev17.yml index f7265dd..f0fd59f 100644 --- a/build/UVAtlas-GitHub-Dev17.yml +++ b/build/UVAtlas-GitHub-Dev17.yml @@ -12,36 +12,15 @@ schedules: include: - main -trigger: - branches: - include: - - main - paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.nuget/*' - - build/*.cmake - - build/*.in - - build/*.mdb - - build/*.ps1 - +# GitHub Actions handles MSBuild for CI/PR +trigger: none pr: branches: include: - main paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.nuget/*' - - build/*.cmake - - build/*.in - - build/*.mdb - - build/*.ps1 - drafts: false + include: + - build/UVAtlas-GitHub-Dev17.yml resources: repositories: diff --git a/build/UVAtlas-GitHub-MinGW.yml b/build/UVAtlas-GitHub-MinGW.yml index 123f2e3..fdd0a23 100644 --- a/build/UVAtlas-GitHub-MinGW.yml +++ b/build/UVAtlas-GitHub-MinGW.yml @@ -20,7 +20,10 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.json + - build/*.props - build/*.mdb - build/*.ps1 @@ -32,7 +35,10 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.json + - build/*.props - build/*.mdb - build/*.ps1 drafts: false diff --git a/build/UVAtlas-GitHub-Test-Dev17.yml b/build/UVAtlas-GitHub-Test-Dev17.yml index 698aeea..13eb51a 100644 --- a/build/UVAtlas-GitHub-Test-Dev17.yml +++ b/build/UVAtlas-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/UVAtlas-GitHub-Test.yml b/build/UVAtlas-GitHub-Test.yml index 2c48a88..42d96d4 100644 --- a/build/UVAtlas-GitHub-Test.yml +++ b/build/UVAtlas-GitHub-Test.yml @@ -12,36 +12,15 @@ schedules: include: - main -trigger: - branches: - include: - - main - paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.nuget/*' - - build/*.cmake - - build/*.in - - build/*.mdb - - build/*.ps1 - +# GitHub Actions handles test suite for CI/PR +trigger: none pr: branches: include: - main paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.nuget/*' - - build/*.cmake - - build/*.in - - build/*.mdb - - build/*.ps1 - drafts: false + include: + - build/UVAtlas-GitHub-Test.yml name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) diff --git a/build/UVAtlas-GitHub-WSL-11.yml b/build/UVAtlas-GitHub-WSL-11.yml index 2f45be4..d6b2506 100644 --- a/build/UVAtlas-GitHub-WSL-11.yml +++ b/build/UVAtlas-GitHub-WSL-11.yml @@ -23,6 +23,7 @@ pr: - CMake* - build/*.cmake - build/*.in + - build/vcpkg.json - build/UVAtlas-GitHub-WSL-11.yml resources: @@ -39,7 +40,8 @@ pool: variables: Codeql.Enabled: false - VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake' + VCPKG_ROOT: '$(Build.SourcesDirectory)/vcpkg' + VCPKG_CMAKE_DIR: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake' GITHUB_PAT: $(GITHUBPUBLICTOKEN) LOCAL_PKG_DIR: '$(Agent.BuildDirectory)/install/' @@ -154,13 +156,13 @@ jobs: - task: CmdLine@2 displayName: VCPKG install headers inputs: - script: $(Build.SourcesDirectory)/vcpkg/vcpkg install directxmath directx-headers eigen3 spectra + script: $(Build.SourcesDirectory)/vcpkg/vcpkg install --x-manifest-root=$(Build.SourcesDirectory)/build workingDirectory: $(Build.SourcesDirectory)/vcpkg - task: CMake@1 displayName: CMake UVAtlas (Config) dbg inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" + cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR=$(Build.SourcesDirectory)/build - task: CMake@1 displayName: CMake UVAtlas (Build) dbg inputs: @@ -170,7 +172,7 @@ jobs: displayName: CMake UVAtlas (Config) rel inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" + cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR=$(Build.SourcesDirectory)/build - task: CMake@1 displayName: CMake UVAtlas (Build) rel inputs: @@ -180,7 +182,7 @@ jobs: displayName: CMake UVAtlas (Config) w/ Eigen inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE=Debug -DENABLE_USE_EIGEN=ON -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" + cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE=Debug -DENABLE_USE_EIGEN=ON -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR=$(Build.SourcesDirectory)/build - task: CMake@1 displayName: CMake UVAtlas (Build) w/ Eigen inputs: diff --git a/build/UVAtlas-GitHub-WSL.yml b/build/UVAtlas-GitHub-WSL.yml index 683fc72..d0f32ab 100644 --- a/build/UVAtlas-GitHub-WSL.yml +++ b/build/UVAtlas-GitHub-WSL.yml @@ -20,7 +20,9 @@ trigger: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.props - build/*.mdb - build/*.ps1 @@ -32,7 +34,9 @@ pr: exclude: - '*.md' - LICENSE + - '.github/*' - '.nuget/*' + - build/*.props - build/*.mdb - build/*.ps1 drafts: false @@ -50,7 +54,8 @@ pool: variables: Codeql.Enabled: false - VCPKG_CMAKE_DIR: '$(VCPKG_ROOT)/scripts/buildsystems/vcpkg.cmake' + VCPKG_ROOT: '$(Build.SourcesDirectory)/vcpkg' + VCPKG_CMAKE_DIR: '$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake' GITHUB_PAT: $(GITHUBPUBLICTOKEN) LOCAL_PKG_DIR: '$(Agent.BuildDirectory)/install/' @@ -165,13 +170,13 @@ jobs: - task: CmdLine@2 displayName: VCPKG install headers inputs: - script: $(Build.SourcesDirectory)/vcpkg/vcpkg install directxmath directx-headers eigen3 spectra + script: $(Build.SourcesDirectory)/vcpkg/vcpkg install --x-manifest-root=$(Build.SourcesDirectory)/build workingDirectory: $(Build.SourcesDirectory)/vcpkg - task: CMake@1 displayName: CMake UVAtlas (Config) dbg inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" + cmakeArgs: -B out -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR=$(Build.SourcesDirectory)/build - task: CMake@1 displayName: CMake UVAtlas (Build) dbg inputs: @@ -181,7 +186,7 @@ jobs: displayName: CMake UVAtlas (Config) rel inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" + cmakeArgs: -B out2 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR=$(Build.SourcesDirectory)/build - task: CMake@1 displayName: CMake UVAtlas (Build) rel inputs: @@ -191,7 +196,7 @@ jobs: displayName: CMake UVAtlas (Config) w/ Eigen inputs: cwd: '$(Build.SourcesDirectory)' - cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE=Debug -DENABLE_USE_EIGEN=ON -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" + cmakeArgs: -B out3 -DCMAKE_BUILD_TYPE=Debug -DENABLE_USE_EIGEN=ON -DCMAKE_TOOLCHAIN_FILE="$(VCPKG_CMAKE_DIR)" -DVCPKG_MANIFEST_DIR=$(Build.SourcesDirectory)/build - task: CMake@1 displayName: CMake UVAtlas (Build) w/ Eigen inputs: diff --git a/build/UVAtlas-GitHub.yml b/build/UVAtlas-GitHub.yml index 7edc15f..7e26bab 100644 --- a/build/UVAtlas-GitHub.yml +++ b/build/UVAtlas-GitHub.yml @@ -6,42 +6,21 @@ # Builds the library for Windows Desktop and UWP. schedules: -- cron: "0 5 * * *" +- cron: "40 5 * * *" displayName: 'Nightly build' branches: include: - main -trigger: - branches: - include: - - main - paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.nuget/*' - - build/*.cmake - - build/*.in - - build/*.mdb - - build/*.ps1 - +# GitHub Actions handles MSBuild for CI/PR +trigger: none pr: branches: include: - main paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.nuget/*' - - build/*.cmake - - build/*.in - - build/*.mdb - - build/*.ps1 - drafts: false + include: + - build/UVAtlas-GitHub.yml resources: repositories: diff --git a/build/UVAtlas-SDL.yml b/build/UVAtlas-SDL.yml index 7972035..8848812 100644 --- a/build/UVAtlas-SDL.yml +++ b/build/UVAtlas-SDL.yml @@ -12,8 +12,15 @@ schedules: include: - main +# GitHub Actions handles CodeQL and PREFAST for CI/PR trigger: none -pr: none +pr: + branches: + include: + - main + paths: + include: + - build/UVAtlas-SDL.yml resources: repositories: diff --git a/build/vcpkg.json b/build/vcpkg.json new file mode 100644 index 0000000..e49504a --- /dev/null +++ b/build/vcpkg.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "dependencies": [ + "directxmath", + "directx-headers", + "directxtex", + "directxmesh", + "eigen3", + "spectra" + ] + } \ No newline at end of file