2
0
mirror of https://github.com/boostorg/cmake.git synced 2026-01-23 05:22:14 +00:00
Files
cmake/.github/workflows/ci.yml
2021-06-06 04:23:27 +03:00

137 lines
4.2 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- master
- develop
- feature/**
env:
UBSAN_OPTIONS: print_stacktrace=1
jobs:
posix:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
shared: OFF
layout: tagged
python: ON
mpi: OFF
- os: ubuntu-latest
shared: ON
layout: versioned
python: ON
mpi: OFF
- os: ubuntu-latest
shared: ON
layout: system
python: ON
mpi: ON
install: libopenmpi-dev
- os: macos-latest
shared: OFF
layout: versioned
python: ON
mpi: OFF
- os: macos-latest
shared: ON
layout: tagged
python: ON
mpi: OFF
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Install packages
if: matrix.install
run: sudo apt install ${{matrix.install}}
- name: Setup Boost
run: |
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 3
rm -rf tools/cmake/*
cp -r $GITHUB_WORKSPACE/* tools/cmake
- name: Build and install Boost with CMake
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_ENABLE_CMAKE=ON -DCMAKE_INSTALL_PREFIX=~/.local -DBoost_VERBOSE=${{matrix.verbose}} -DBOOST_INCLUDE_LIBRARIES=${{matrix.include}} -DBOOST_EXCLUDE_LIBRARIES=${{matrix.exclude}} -DBUILD_SHARED_LIBS=${{matrix.shared}} -DBOOST_INSTALL_LAYOUT=${{matrix.layout}} -DBOOST_ENABLE_MPI=${{matrix.mpi}} -DBOOST_ENABLE_PYTHON=${{matrix.python}} ..
cmake --build .
cmake --build . --target install
windows:
strategy:
fail-fast: false
matrix:
include:
- os: windows-2016
shared: ON
layout: tagged
python: ON
mpi: OFF
- os: windows-2016
shared: OFF
layout: versioned
python: ON
mpi: OFF
- os: windows-2019
shared: OFF
layout: tagged
python: ON
mpi: OFF
- os: windows-2019
shared: ON
layout: versioned
python: ON
mpi: OFF
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Setup Boost
shell: cmd
run: |
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init --jobs 3
rd /s/q tools\cmake
xcopy /s /e /q %GITHUB_WORKSPACE% tools\cmake\
- name: Build and install Boost with CMake
shell: cmd
run: |
cd ../boost-root
mkdir __build__ && cd __build__
cmake -DBOOST_ENABLE_CMAKE=ON -DBoost_VERBOSE=${{matrix.verbose}} -DBOOST_INCLUDE_LIBRARIES=${{matrix.include}} -DBOOST_EXCLUDE_LIBRARIES=${{matrix.exclude}} -DBUILD_SHARED_LIBS=${{matrix.shared}} -DBOOST_INSTALL_LAYOUT=${{matrix.layout}} -DBOOST_ENABLE_MPI=${{matrix.mpi}} -DBOOST_ENABLE_PYTHON=${{matrix.python}} ..
cmake --build . --config Debug
cmake --build . --config Release
cmake --build . --target install --config Debug
cmake --build . --target install --config Release