diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..cf93faad --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,128 @@ +# 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 }}/MediaMesh + DIRECTXMESH_TEX_PATH: ${{ github.workspace }}/MediaTex + +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 + + steps: + - uses: actions/checkout@v4 + + - name: Clone test repository + uses: actions/checkout@v4 + with: + repository: walbourn/uvatlastest + path: Tests + ref: main + + - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') + name: Clone media repository (Tex) + uses: actions/checkout@v4 + with: + repository: walbourn/directxtexmedia + path: MediaTex + ref: main + lfs: true + + - if: (matrix.build_type == 'x64-Release') || (matrix.build_type == 'x86-Release') + name: Clone media repository (Mesh) + uses: actions/checkout@v4 + with: + repository: walbourn/directxmeshmedia + path: MediaMesh + ref: main + lfs: true + + - name: 'Install Ninja' + run: choco install ninja + + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - uses: lukka/run-vcpkg@v11 + with: + runVcpkgInstall: true + vcpkgJsonGlob: '**/build/vcpkg.json' + + - name: 'Configure CMake' + working-directory: ${{ github.workspace }} + run: cmake --preset=${{ matrix.build_type }} -DBUILD_TOOLS=ON -DBUILD_TESTING=ON -DCMAKE_TOOLCHAIN_FILE=${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}/scripts/buildsystems/vcpkg.cmake + + - 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: 10 + name: 'Test' + working-directory: ${{ github.workspace }} + run: ctest --preset=${{ matrix.build_type }} diff --git a/.gitignore b/.gitignore index 22db94d6..7e8dc205 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ packages /wiki /out /CMakeUserPresets.json +/build/vcpkg_installed diff --git a/build/UVAtlas-GitHub-CMake-Dev17.yml b/build/UVAtlas-GitHub-CMake-Dev17.yml index 5d34c6b9..135d2aae 100644 --- a/build/UVAtlas-GitHub-CMake-Dev17.yml +++ b/build/UVAtlas-GitHub-CMake-Dev17.yml @@ -22,6 +22,7 @@ trigger: - LICENSE - '.github/*' - '.nuget/*' + - build/*.json - build/*.props - build/*.mdb - build/*.ps1 @@ -36,6 +37,7 @@ pr: - LICENSE - '.github/*' - '.nuget/*' + - build/*.json - build/*.props - build/*.mdb - build/*.ps1 diff --git a/build/UVAtlas-GitHub-CMake.yml b/build/UVAtlas-GitHub-CMake.yml index 23f8589b..d2d4a9ff 100644 --- a/build/UVAtlas-GitHub-CMake.yml +++ b/build/UVAtlas-GitHub-CMake.yml @@ -22,6 +22,7 @@ trigger: - LICENSE - '.github/*' - '.nuget/*' + - build/*.json - build/*.props - build/*.mdb - build/*.ps1 @@ -36,6 +37,7 @@ pr: - LICENSE - '.github/*' - '.nuget/*' + - build/*.json - build/*.props - build/*.mdb - build/*.ps1 diff --git a/build/UVAtlas-GitHub-MinGW.yml b/build/UVAtlas-GitHub-MinGW.yml index 6650ab90..fdd0a23b 100644 --- a/build/UVAtlas-GitHub-MinGW.yml +++ b/build/UVAtlas-GitHub-MinGW.yml @@ -22,6 +22,7 @@ trigger: - LICENSE - '.github/*' - '.nuget/*' + - build/*.json - build/*.props - build/*.mdb - build/*.ps1 @@ -36,6 +37,7 @@ pr: - LICENSE - '.github/*' - '.nuget/*' + - build/*.json - build/*.props - build/*.mdb - build/*.ps1 diff --git a/build/UVAtlas-GitHub-Test-Dev17.yml b/build/UVAtlas-GitHub-Test-Dev17.yml index 698aeead..13eb51a9 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 a7b06516..42d96d47 100644 --- a/build/UVAtlas-GitHub-Test.yml +++ b/build/UVAtlas-GitHub-Test.yml @@ -12,38 +12,15 @@ schedules: include: - main -trigger: - branches: - include: - - main - paths: - exclude: - - '*.md' - - LICENSE - - CMake* - - '.github/*' - - '.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* - - '.github/*' - - '.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 2f45be4f..57140aca 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: @@ -154,7 +155,7 @@ 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 diff --git a/build/UVAtlas-GitHub-WSL.yml b/build/UVAtlas-GitHub-WSL.yml index da0d9c3f..eeb6af38 100644 --- a/build/UVAtlas-GitHub-WSL.yml +++ b/build/UVAtlas-GitHub-WSL.yml @@ -169,7 +169,7 @@ 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 diff --git a/build/vcpkg.json b/build/vcpkg.json new file mode 100644 index 00000000..e49504a7 --- /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