cppzmq/.github/workflows/ci.yml
2021-07-14 11:44:07 +00:00

156 lines
4.3 KiB
YAML

name: CI
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
cppstd: ["98", "11", "20"]
cc: ["gcc-10"]
cxx: ["g++-10"]
drafts: ["ON"]
libzmq: ["4.3.4"]
libzmqbuild: ["cmake"]
platform: [""]
include:
# older libzmq and gcc without draft
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-7"
cxx: "g++-7"
drafts: "OFF"
libzmq: "4.2.0"
libzmqbuild: "pkgconfig"
# gcc 4.8
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-4.8"
cxx: "g++-4.8"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
aptinstall: "gcc-4.8 g++-4.8"
# gcc 5
- os: "ubuntu-18.04"
cppstd: "11"
cc: "gcc-5"
cxx: "g++-5"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
aptinstall: "gcc-5 g++-5"
# without draft
- os: "ubuntu-latest"
cppstd: "20"
cc: "gcc-10"
cxx: "g++-10"
drafts: "OFF"
libzmq: "4.3.4"
libzmqbuild: "cmake"
# clang
- os: "ubuntu-latest"
cppstd: "17"
cc: "clang-12"
cxx: "clang++-12"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
# windows
- os: "windows-2016"
cppstd: "14"
cc: "msbuild"
cxx: "msbuild"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
platform: "-Ax64"
- os: "windows-latest"
cppstd: "20"
cc: "msbuild"
cxx: "msbuild"
drafts: "ON"
libzmq: "4.3.4"
libzmqbuild: "cmake"
platform: "-Ax64"
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
VERBOSE: 1
THREADS: 2
BUILDTYPE: "Debug"
COVERAGE: "OFF" # TODO
steps:
- uses: actions/checkout@v2
- name: install_deps
if: matrix.aptinstall
run: sudo apt install ${{matrix.aptinstall}}
- name: get_libzmq
run: |
curl -L https://github.com/zeromq/libzmq/archive/v${{ matrix.libzmq }}.tar.gz \
>zeromq.tar.gz
tar -xvzf zeromq.tar.gz
- name: build_libzmq_cmake
if: ${{ matrix.libzmqbuild == 'cmake' }}
run: |
cmake -Hlibzmq-${{ matrix.libzmq }} -Blibzmq-build ${{ matrix.platform}} \
-DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_DRAFTS=${{ matrix.drafts }}
cmake --build libzmq-build --config ${BUILDTYPE} -j ${THREADS}
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build_libzmq_pkgconfig
if: ${{ matrix.libzmqbuild == 'pkgconfig' }}
working-directory: libzmq-${{ matrix.libzmq }}
run: |
./autogen.sh &&
./configure --prefix=${PWD}/libzmq-build &&
make -j ${THREADS}
make install
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build
env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}
run: |
cmake -H. -Bbuild ${{ matrix.platform}} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DENABLE_DRAFTS=${{ matrix.drafts }} \
-DCOVERAGE=${COVERAGE} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build --config ${BUILDTYPE} -j ${THREADS}
echo "CPPZMQ=${PWD}/build" >> ${GITHUB_ENV}
- name: test
run: |
cd ${{ env.CPPZMQ }}
echo ${{ env.CPPZMQ }}
ctest -V -C ${BUILDTYPE}
ctest -V -R "()"
- name: demo
# probably need to install libzmq and cppzmq for this to work on windows
if: ${{ matrix.os == 'ubuntu*' }}
env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}:${{ env.CPPZMQ }}
run: |
cd demo
cmake -H. -Bbuild ${{ matrix.platform}} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build --config ${BUILDTYPE}
cd build
ctest -V -C ${BUILDTYPE}