2020-03-21 09:59:32 +00:00
|
|
|
name: C/C++ CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
jobs:
|
2020-04-26 19:19:59 +00:00
|
|
|
job:
|
2020-04-27 16:51:02 +00:00
|
|
|
name: ${{ matrix.os }}-${{ matrix.cxx }}-build-and-test
|
2020-04-26 19:19:59 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2020-04-28 05:39:13 +00:00
|
|
|
name: [ubuntu-gcc, macos-clang, windows-msvc, ubuntu-clang]
|
2020-04-27 16:51:02 +00:00
|
|
|
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
|
2020-04-26 19:19:59 +00:00
|
|
|
include:
|
2020-04-28 05:39:13 +00:00
|
|
|
- name: windows-msvc
|
|
|
|
os: windows-latest
|
2020-04-26 19:19:59 +00:00
|
|
|
cxx: cl.exe
|
|
|
|
cc: cl.exe
|
2020-04-28 05:39:13 +00:00
|
|
|
- name: ubuntu-clang
|
|
|
|
os: ubuntu-latest
|
2020-04-26 19:19:59 +00:00
|
|
|
cxx: clang++
|
|
|
|
cc: clang
|
2020-04-28 05:39:13 +00:00
|
|
|
- name: macos-clang
|
|
|
|
os: macos-latest
|
2020-04-26 19:19:59 +00:00
|
|
|
cxx: clang++
|
|
|
|
cc: clang
|
2020-04-28 05:39:13 +00:00
|
|
|
- name: ubuntu-gcc
|
|
|
|
os: ubuntu-latest
|
|
|
|
cxx: g++
|
|
|
|
cc: gcc
|
2020-04-26 19:19:59 +00:00
|
|
|
|
2020-03-21 09:59:32 +00:00
|
|
|
steps:
|
2020-04-15 14:29:55 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-03-29 15:55:28 +00:00
|
|
|
|
2020-04-26 19:19:59 +00:00
|
|
|
- uses: lukka/get-cmake@latest
|
2020-03-29 16:39:55 +00:00
|
|
|
|
2020-04-26 19:19:59 +00:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
|
|
|
|
- uses: lukka/set-shell-env@v1
|
|
|
|
with:
|
|
|
|
CXX: ${{ matrix.cxx }}
|
|
|
|
CC: ${{ matrix.cc }}
|
2020-06-19 07:15:12 +00:00
|
|
|
|
|
|
|
- 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'"
|
2020-04-26 19:19:59 +00:00
|
|
|
|
|
|
|
- name: configure and build
|
|
|
|
uses: lukka/run-cmake@v2
|
2020-06-19 07:15:12 +00:00
|
|
|
env:
|
|
|
|
DXSDK_DIR: '${{ github.workspace }}/DX_SDK'
|
|
|
|
|
2020-04-26 19:19:59 +00:00
|
|
|
with:
|
|
|
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
|
|
|
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
|
2020-06-19 07:15:12 +00:00
|
|
|
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release ${{ steps.windows_extra_cmake_args.outputs.args }}'
|
2020-04-26 19:19:59 +00:00
|
|
|
buildWithCMakeArgs: '-- -v'
|
|
|
|
buildDirectory: '${{ github.workspace }}/build/'
|
|
|
|
|
2020-03-29 16:39:55 +00:00
|
|
|
- name: test
|
2020-04-26 19:19:59 +00:00
|
|
|
run: cd build/bin && ./unit
|
|
|
|
shell: bash
|
2020-06-19 07:15:12 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: matrix.name == 'windows-msvc'
|
|
|
|
with:
|
|
|
|
name: 'assimp-bins-${{ matrix.name }}-${{ github.sha }}'
|
|
|
|
path: build/bin
|