This commit introduces Github Actions support for building the tools and viewer and making these available for download as a zip file in the artifacts area of the Github Actions page. This allows for continuous validation that the viewer and tools build successfully, and the download is useful for quick testing of the very latest assimp functionality without needing to download and build it from source. This only applies to windows-msvc, since the assimp viewer is only supported on that platform. It downloads the June 2010 DirectX SDK from the Microsoft servers and installs it. It also uses a cache to prevent having to perform this DX SDK download and installation repeatedly for every commit. Note, it's necessary install the older June 2010 DXSDK because assimp uses the now deprecated D3DX libraries, and these libraries are not included in the stock Windows Server image provided by Github Actions.
90 lines
2.6 KiB
YAML
90 lines
2.6 KiB
YAML
name: C/C++ CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
job:
|
|
name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang]
|
|
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
|
|
include:
|
|
- name: windows-msvc
|
|
os: windows-latest
|
|
cxx: cl.exe
|
|
cc: cl.exe
|
|
- name: ubuntu-clang
|
|
os: ubuntu-latest
|
|
cxx: clang++
|
|
cc: clang
|
|
- name: macos-clang
|
|
os: macos-latest
|
|
cxx: clang++
|
|
cc: clang
|
|
- name: ubuntu-gcc
|
|
os: ubuntu-latest
|
|
cxx: g++
|
|
cc: gcc
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: lukka/get-cmake@latest
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
- uses: lukka/set-shell-env@v1
|
|
with:
|
|
CXX: ${{ matrix.cxx }}
|
|
CC: ${{ matrix.cc }}
|
|
|
|
- name: Cache DX SDK
|
|
id: dxcache
|
|
if: matrix.name == 'windows-msvc'
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: '${{ github.workspace }}/DX_SDK'
|
|
key: ${{ runner.os }}-DX_SDK
|
|
restore-keys: |
|
|
${{ runner.os }}-DX_SDK
|
|
|
|
- name: Download DXSetup
|
|
if: matrix.name == 'windows-msvc' && steps.dxcache.outputs.cache-hit != 'true'
|
|
run: |
|
|
curl -s -o DXSDK_Jun10.exe --location https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe
|
|
cmd.exe /c start /wait .\DXSDK_Jun10.exe /U /O /F /S /P "${{ github.workspace }}\DX_SDK"
|
|
|
|
- name: Set Windows specific CMake arguments
|
|
if: matrix.name == 'windows-msvc'
|
|
id: windows_extra_cmake_args
|
|
run: echo "::set-output name=args::'-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1'"
|
|
|
|
- name: configure and build
|
|
uses: lukka/run-cmake@v2
|
|
env:
|
|
DXSDK_DIR: '${{ github.workspace }}/DX_SDK'
|
|
|
|
with:
|
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
|
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
|
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release ${{ steps.windows_extra_cmake_args.outputs.args }}'
|
|
buildWithCMakeArgs: '-- -v'
|
|
buildDirectory: '${{ github.workspace }}/build/'
|
|
|
|
- name: test
|
|
run: cd build/bin && ./unit
|
|
shell: bash
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
if: matrix.name == 'windows-msvc'
|
|
with:
|
|
name: 'assimp-bins-${{ matrix.name }}-${{ github.sha }}'
|
|
path: build/bin
|