Call vinecopulib script for installing dependencies (#19) #116
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: Build Status | |
on: [push] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
max-parallel: 6 | |
matrix: | |
cfg: | |
- { os: ubuntu-latest, name: GNU, cc: gcc, cxx: g++, platform: x64, root_install_dir: '/home/runner/work'} | |
- { os: ubuntu-latest, name: Clang, cc: clang, cxx: clang++, platform: x64, root_install_dir: '/home/runner/work'} | |
- { os: macos-13, name: Clang, cc: clang, cxx: clang++, platform: x64, root_install_dir: '/Users/runner/work'} # intel runner | |
- { os: macos-14, name: Clang, cc: clang, cxx: clang++, platform: x64, root_install_dir: '/Users/runner/work'} # apple silicon runner | |
- { os: windows-latest, name: x32, cc: cl, cxx: cl, platform: x32, root_install_dir: 'D:\'} | |
- { os: windows-latest, name: x64, cc: cl, cxx: cl, platform: x64, root_install_dir: 'D:\'} | |
env: | |
BOOST_VERSION: 1.84.0 | |
EIGEN_VERSION: 3.4.0 | |
runs-on: ${{ matrix.cfg.os }} | |
name: ${{ matrix.cfg.os }} (${{ matrix.cfg.name }}, ${{ matrix.cfg.platform }}) | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
id: install-dependencies | |
uses: vinecopulib/vinecopulib/.github/actions/install-dependencies@better-actions | |
with: | |
os: ${{ matrix.cfg.os }} | |
platform: ${{ matrix.cfg.platform }} | |
boost_install_dir: ${{ matrix.cfg.root_install_dir }} | |
eigen_install_dir: ${{ matrix.cfg.root_install_dir }} | |
boost_version: ${{ env.BOOST_VERSION }} | |
eigen_version: ${{ env.EIGEN_VERSION }} | |
wdm: 'false' | |
- name: Set environment variables and path | |
run: | | |
echo "CC=${{ matrix.cfg.cc }}" >> $GITHUB_ENV | |
echo "CXX=${{ matrix.cfg.cxx }}" >> $GITHUB_ENV | |
echo "BOOST_ROOT=${{ steps.install-dependencies.outputs.BOOST_ROOT }}" >> $GITHUB_ENV | |
echo "Boost_INCLUDE_DIR =${{ steps.install-dependencies.outputs.BOOST_ROOT }}/ include" >> $GITHUB_ENV | |
echo "EIGEN3_INCLUDE_DIR=${{ steps.install-dependencies.outputs.EIGEN3_ROOT }}/ include/eigen3" >> $GITHUB_ENV | |
if [ "${{ matrix.cfg.os }}" == "windows-latest" ]; then | |
cmd "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.cfg. platform }} | |
echo "D:\a\vinecopulib\kde1d-cpp\release" >> $GITHUB_PATH | |
echo "D:\a\vinecopulib\kde1d-cpp\release\Release" >> $GITHUB_PATH | |
fi | |
shell: bash | |
- name: Compile the debug version | |
run: | | |
mkdir debug && cd debug | |
if [ "${{ matrix.cfg.os }}" != "windows-latest" ]; then | |
if [ "${{ matrix.cfg.os }}/${{ matrix.cfg.name }}" == "ubuntu-latest/GNU" ]; then | |
cmake .. -DSTRICT_COMPILER=ON \ | |
-DCODE_COVERAGE=ON -DOPT_ASAN=OFF \ | |
-DCMAKE_BUILD_TYPE=Debug | |
make kde1d_coverage | |
else | |
cmake .. -DOPT_ASAN=OFF -DCMAKE_BUILD_TYPE=Debug | |
make | |
fi | |
else | |
cmake .. -G "Visual Studio 17 2022" -A "${CMAKE_GEN_PLAT}" \ | |
-DCMAKE_BUILD_TYPE=Debug | |
cmake --build . | |
fi | |
shell: bash | |
- name: Code coverage | |
uses: codecov/codecov-action@v3 | |
if: contains(matrix.cfg.os, 'ubuntu') && contains(matrix.cfg.name, 'GNU') | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
file: debug/coverage.info | |
- name: Compile and test the release version | |
run: | | |
mkdir release && cd release | |
if [ "${{ matrix.cfg.os }}" != "windows-latest" ]; then | |
cmake .. -DCMAKE_BUILD_TYPE=Release && make && sudo make install | |
bin/test | |
else | |
cmake .. -G "Visual Studio 17 2022" -A "${CMAKE_GEN_PLAT}" -DCMAKE_BUILD_TYPE=Release | |
cmake --build . --config Release | |
"bin/Release/test.exe" | |
cmake --build . --config Release --target install | |
fi | |
shell: bash |