[cmake] Do not use dll symbol in static libraries #170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ubuntu | |
on: | |
workflow_dispatch: | |
push: | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: "${{matrix.compiler}} ${{matrix.BUILD_TYPE}}${{matrix.LLVM_VER && format(' LLVM{0}', matrix.LLVM_VER) || ''}}${{matrix.ENABLE_SIMD == 'On' && ' SIMD' || ''}}" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
BUILD_TYPE: [ Release, Debug ] | |
compiler: [ gcc, clang ] | |
LLVM_VER: [ '', 13 ] | |
ENABLE_SIMD: [ On ] | |
exclude: | |
- BUILD_TYPE: Release | |
compiler: clang | |
LLVM_VER: '' | |
ENABLE_SIMD: On | |
- BUILD_TYPE: Debug | |
compiler: clang | |
LLVM_VER: '' | |
ENABLE_SIMD: On | |
include: | |
- BUILD_TYPE: Debug | |
compiler: gcc | |
LLVM_VER: 11 | |
ENABLE_SIMD: On | |
- BUILD_TYPE: Debug | |
compiler: gcc | |
LLVM_VER: 12 | |
ENABLE_SIMD: On | |
- BUILD_TYPE: Debug | |
compiler: gcc | |
LLVM_VER: 12 | |
ENABLE_SIMD: Off | |
env: | |
CC: ${{matrix.compiler}} | |
CXX: ${{matrix.compiler == 'gcc' && 'g++' || 'clang++'}} | |
CXXFLAGS_COV: -fprofile-arcs -ftest-coverage | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: sudo apt-get install libopenlibm-dev libsleef-dev libzmq3-dev libyaml-cpp-dev libtbb-dev | |
- name: Install LLVM | |
if: ${{matrix.LLVM_VER != ''}} | |
run: sudo apt-get install llvm-${{matrix.LLVM_VER}}-dev | |
- name: Configure CMake | |
run: CXXFLAGS+=" ${CXXFLAGS_COV}" cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DENABLE_SIMD=${{matrix.ENABLE_SIMD}} -DENABLE_LLVM=${{matrix.LLVM_VER != '' && 'On' || 'Off'}} -DLLVM_DIR=/usr/lib/llvm-${{matrix.LLVM_VER}}/cmake | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.BUILD_TYPE}} -j $(nproc) | |
- name: Builder info | |
run: ${{github.workspace}}/build/tools/nacs-cpudump | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.BUILD_TYPE}} -E /excluded --output-on-failure -j $(nproc) | |
- name: Generate coverage report (GCC) | |
if: ${{matrix.compiler == 'gcc'}} | |
run: | | |
find ${{github.workspace}}/build/{lib,tools} -iname '*.o' -exec gcov -abcfupr {} -s ${{github.workspace}} \; | |
- name: Generate coverage report (Clang) | |
if: ${{matrix.compiler == 'clang'}} | |
run: | | |
find ${{github.workspace}}/build/{lib,tools} -iname '*.o' -exec llvm-cov gcov -abcfupr {} -s ${{github.workspace}} \; | |
- name: Upload coverage | |
uses: codecov/codecov-action@v2 |