2020-03-21 09:59:32 +00:00
|
|
|
name: C/C++ CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
2022-09-19 21:31:58 +00:00
|
|
|
permissions:
|
2022-12-09 01:28:32 +00:00
|
|
|
contents: write # to fetch code (actions/checkout),and release
|
2022-09-19 21:31:58 +00:00
|
|
|
|
2020-03-21 09:59:32 +00:00
|
|
|
jobs:
|
2020-04-26 19:19:59 +00:00
|
|
|
job:
|
2020-08-27 17:14:08 +00:00
|
|
|
name: ${{ matrix.name }}-build-and-test
|
2020-04-26 19:19:59 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-02-25 19:52:18 +00:00
|
|
|
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, ubuntu-latest-clang++, ubuntu-gcc-hunter, macos-clang-hunter, windows-msvc-hunter]
|
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-09-17 18:38:49 +00:00
|
|
|
- name: windows-latest-cl.exe
|
2020-04-28 05:39:13 +00:00
|
|
|
os: windows-latest
|
2020-04-26 19:19:59 +00:00
|
|
|
cxx: cl.exe
|
|
|
|
cc: cl.exe
|
2020-09-17 18:38:49 +00:00
|
|
|
- name: ubuntu-latest-clang++
|
2020-04-28 05:39:13 +00:00
|
|
|
os: ubuntu-latest
|
2020-04-26 19:19:59 +00:00
|
|
|
cxx: clang++
|
|
|
|
cc: clang
|
2020-09-17 18:38:49 +00:00
|
|
|
- name: macos-latest-clang++
|
2020-04-28 05:39:13 +00:00
|
|
|
os: macos-latest
|
2020-04-26 19:19:59 +00:00
|
|
|
cxx: clang++
|
|
|
|
cc: clang
|
2020-09-17 18:38:49 +00:00
|
|
|
- name: ubuntu-latest-g++
|
2020-04-28 05:39:13 +00:00
|
|
|
os: ubuntu-latest
|
|
|
|
cxx: g++
|
|
|
|
cc: gcc
|
2020-08-27 17:14:08 +00:00
|
|
|
- name: ubuntu-gcc-hunter
|
|
|
|
os: ubuntu-latest
|
|
|
|
toolchain: ninja-gcc-cxx17-fpic
|
|
|
|
- name: macos-clang-hunter
|
|
|
|
os: macos-latest
|
|
|
|
toolchain: ninja-clang-cxx17-fpic
|
2022-02-25 19:52:18 +00:00
|
|
|
- name: windows-msvc-hunter
|
|
|
|
os: windows-latest
|
|
|
|
toolchain: ninja-vs-win64-cxx17
|
2020-04-26 19:19:59 +00:00
|
|
|
|
2020-03-21 09:59:32 +00:00
|
|
|
steps:
|
2022-07-06 07:37:31 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-11-13 18:33:12 +00:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
|
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
|
|
|
|
|
2020-08-27 17:14:08 +00:00
|
|
|
- name: Set Compiler Environment
|
|
|
|
if: "!endsWith(matrix.name, 'hunter')"
|
|
|
|
uses: lukka/set-shell-env@v1
|
2020-04-26 19:19:59 +00:00
|
|
|
with:
|
|
|
|
CXX: ${{ matrix.cxx }}
|
|
|
|
CC: ${{ matrix.cc }}
|
2020-06-19 07:15:12 +00:00
|
|
|
|
2020-08-27 17:14:08 +00:00
|
|
|
- name: Set Compiler Environment for Hunter on Windows
|
|
|
|
if: startsWith(matrix.name, 'windows') && endsWith(matrix.name, 'hunter')
|
|
|
|
uses: lukka/set-shell-env@v1
|
|
|
|
with:
|
|
|
|
VS160COMNTOOLS: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools
|
|
|
|
|
|
|
|
- name: Checkout Hunter toolchains
|
|
|
|
if: endsWith(matrix.name, 'hunter')
|
2022-07-06 07:37:31 +00:00
|
|
|
uses: actions/checkout@v3
|
2020-08-27 17:14:08 +00:00
|
|
|
with:
|
|
|
|
repository: cpp-pm/polly
|
2021-01-29 22:10:38 +00:00
|
|
|
path: cmake/polly
|
|
|
|
|
|
|
|
- name: Remove contrib directory for Hunter builds
|
|
|
|
if: contains(matrix.name, 'hunter')
|
2022-07-05 20:00:56 +00:00
|
|
|
uses: JesseTG/rm@v1.0.3
|
2021-01-29 22:10:38 +00:00
|
|
|
with:
|
|
|
|
path: contrib
|
2020-08-27 17:14:08 +00:00
|
|
|
|
2020-06-19 07:15:12 +00:00
|
|
|
- name: Cache DX SDK
|
|
|
|
id: dxcache
|
2020-08-27 17:14:08 +00:00
|
|
|
if: contains(matrix.name, 'windows')
|
2022-07-05 20:00:53 +00:00
|
|
|
uses: actions/cache@v3
|
2020-06-19 07:15:12 +00:00
|
|
|
with:
|
|
|
|
path: '${{ github.workspace }}/DX_SDK'
|
|
|
|
key: ${{ runner.os }}-DX_SDK
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-DX_SDK
|
|
|
|
|
|
|
|
- name: Download DXSetup
|
2020-08-27 17:14:08 +00:00
|
|
|
if: contains(matrix.name, 'windows') && steps.dxcache.outputs.cache-hit != 'true'
|
2020-06-19 07:15:12 +00:00
|
|
|
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
|
2020-08-27 17:14:08 +00:00
|
|
|
if: contains(matrix.name, 'windows')
|
2020-06-19 07:15:12 +00:00
|
|
|
id: windows_extra_cmake_args
|
2020-08-27 17:14:08 +00:00
|
|
|
run: echo "::set-output name=args::-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1"
|
2020-04-26 19:19:59 +00:00
|
|
|
|
2020-08-27 17:14:08 +00:00
|
|
|
- name: Set Hunter specific CMake arguments
|
|
|
|
if: contains(matrix.name, 'hunter')
|
|
|
|
id: hunter_extra_cmake_args
|
|
|
|
run: echo "::set-output name=args::-DBUILD_SHARED_LIBS=OFF -DASSIMP_HUNTER_ENABLED=ON -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/cmake/polly/${{ matrix.toolchain }}.cmake"
|
|
|
|
|
2020-04-26 19:19:59 +00:00
|
|
|
- name: configure and build
|
2020-09-30 17:28:04 +00:00
|
|
|
uses: lukka/run-cmake@v3
|
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-08-27 17:14:08 +00:00
|
|
|
cmakeAppendedArgs: '-GNinja -DCMAKE_BUILD_TYPE=Release ${{ steps.windows_extra_cmake_args.outputs.args }} ${{ steps.hunter_extra_cmake_args.outputs.args }}'
|
2022-11-29 08:34:56 +00:00
|
|
|
buildWithCMakeArgs: '--parallel 24 -v'
|
2020-04-26 19:19:59 +00:00
|
|
|
buildDirectory: '${{ github.workspace }}/build/'
|
|
|
|
|
2020-08-27 17:14:08 +00:00
|
|
|
- name: Exclude certain tests in Hunter specific builds
|
|
|
|
if: contains(matrix.name, 'hunter')
|
|
|
|
id: hunter_extra_test_args
|
|
|
|
run: echo "::set-output name=args::--gtest_filter=-utOpenGEXImportExport.Importissue1340_EmptyCameraObject:utColladaZaeImportExport.importBlenFromFileTest"
|
|
|
|
|
2020-03-29 16:39:55 +00:00
|
|
|
- name: test
|
2020-08-27 17:14:08 +00:00
|
|
|
run: cd build/bin && ./unit ${{ steps.hunter_extra_test_args.outputs.args }}
|
2020-04-26 19:19:59 +00:00
|
|
|
shell: bash
|
2020-06-19 07:15:12 +00:00
|
|
|
|
2022-07-06 11:41:23 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-12-07 17:07:19 +00:00
|
|
|
if: contains(matrix.name, 'windows')
|
2020-06-19 07:15:12 +00:00
|
|
|
with:
|
|
|
|
name: 'assimp-bins-${{ matrix.name }}-${{ github.sha }}'
|
|
|
|
path: build/bin
|
2022-12-08 11:50:48 +00:00
|
|
|
|
|
|
|
- uses: marvinpinto/action-automatic-releases@latest
|
|
|
|
with:
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
2022-12-08 16:34:19 +00:00
|
|
|
automatic_release_tag: "master"
|
2022-12-08 11:50:48 +00:00
|
|
|
prerelease: true
|
|
|
|
title: "AutoRelease"
|
|
|
|
files: |
|
|
|
|
build/bin/*
|