Skip to content

Commit

Permalink
Add GitHub actions test
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Jul 29, 2024
1 parent 7e107f8 commit 36985dd
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 30 deletions.
128 changes: 128 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ packages
/wiki
/out
/CMakeUserPresets.json
/build/vcpkg_installed
2 changes: 2 additions & 0 deletions build/UVAtlas-GitHub-CMake-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ trigger:
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.json
- build/*.props
- build/*.mdb
- build/*.ps1
Expand All @@ -36,6 +37,7 @@ pr:
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.json
- build/*.props
- build/*.mdb
- build/*.ps1
Expand Down
2 changes: 2 additions & 0 deletions build/UVAtlas-GitHub-CMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ trigger:
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.json
- build/*.props
- build/*.mdb
- build/*.ps1
Expand All @@ -36,6 +37,7 @@ pr:
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.json
- build/*.props
- build/*.mdb
- build/*.ps1
Expand Down
2 changes: 2 additions & 0 deletions build/UVAtlas-GitHub-MinGW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ trigger:
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.json
- build/*.props
- build/*.mdb
- build/*.ps1
Expand All @@ -36,6 +37,7 @@ pr:
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.json
- build/*.props
- build/*.mdb
- build/*.ps1
Expand Down
2 changes: 1 addition & 1 deletion build/UVAtlas-GitHub-Test-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ schedules:
include:
- main

# GitHub Actions handles test suite for CI/PR
trigger: none

pr:
branches:
include:
Expand Down
31 changes: 4 additions & 27 deletions build/UVAtlas-GitHub-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 2 additions & 1 deletion build/UVAtlas-GitHub-WSL-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pr:
- CMake*
- build/*.cmake
- build/*.in
- build/vcpkg.json
- build/UVAtlas-GitHub-WSL-11.yml

resources:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/UVAtlas-GitHub-WSL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions build/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
]
}

0 comments on commit 36985dd

Please sign in to comment.