Merge pull request #17 from Flow-IPC/kinokrt-patch-2 #128
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: Flow pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# Make it possible to trigger workflow manually. | |
workflow_dispatch: | |
jobs: | |
doc: | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: | |
- { id: clang-15, name: clang, version: 15, c-path: /usr/bin/clang-15, cpp-path: /usr/bin/clang++-15 } | |
build-type: | |
- { id: release, conan-name: Release, conan-preset: release } | |
runs-on: ubuntu-latest | |
name: | | |
doc-${{ matrix.compiler.id }}-${{ matrix.build-type.id }} | |
steps: | |
- name: Checkout `flow` repository | |
uses: actions/checkout@v4 | |
- name: Update available software list for apt-get | |
run: sudo apt-get update | |
- name: Install Flow dependencies (inc. Graphviz) with apt-get | |
run: | | |
sudo apt-get install -y graphviz | |
- name: Install the latest version of Conan which is less than 2 | |
run: | | |
pip install "conan<2" | |
- name: Create Conan profile | |
run: | | |
cat <<EOF > conan_profile | |
[settings] | |
compiler = ${{ matrix.compiler.name }} | |
compiler.version = ${{ matrix.compiler.version }} | |
compiler.cppstd = 17 | |
compiler.libcxx = libstdc++11 | |
arch = x86_64 | |
os = Linux | |
build_type = ${{ matrix.build-type.conan-name }} | |
[conf] | |
tools.build:compiler_executables = {"c": "${{ matrix.compiler.c-path }}", "cpp": "${{ matrix.compiler.cpp-path }}"} | |
tools.env.virtualenv:auto_use = True | |
[buildenv] | |
CC = ${{ matrix.compiler.c-path }} | |
CXX = ${{ matrix.compiler.cpp-path }} | |
[options] | |
flow:build = False | |
flow:doc = True | |
EOF | |
- name: Install Flow dependencies (inc. Doxygen) with Conan using the profile | |
run: | | |
conan install \ | |
. \ | |
--profile:build=conan_profile \ | |
--profile:host=conan_profile \ | |
--build missing | |
- name: Prepare Makefile using CMake | |
run: | | |
cmake \ | |
--preset ${{ matrix.build-type.conan-preset }} \ | |
-DCFG_ENABLE_DOC_GEN=ON \ | |
-DCFG_SKIP_CODE_GEN=ON | |
- name: Get the number of processor cores for parallelized work | |
uses: SimenB/github-actions-cpu-cores@v1 | |
id: cpu-cores | |
- name: Doxygen-generate documentation sets using Makefile | |
run: | | |
VERBOSE=1 make \ | |
flow_doc_public \ | |
flow_doc_full \ | |
--directory $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }} \ | |
-j${{ steps.cpu-cores.outputs.count }} | |
- name: Package doc tarball [Doxygen documentation sets (full, API-only), landing page] | |
run: | | |
cd $GITHUB_WORKSPACE/doc/flow_doc | |
$GITHUB_WORKSPACE/tools/doc/stage_generated_docs.sh $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }} | |
- name: Upload documentation tarball | |
uses: actions/upload-artifact@v3 | |
with: | |
name: flow-doc-${{ matrix.compiler.id }}-${{ matrix.build-type.id }} | |
path: | | |
${{ github.workspace }}/doc/flow_doc.tgz | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: | |
- { id: gcc-9, name: gcc, version: 9, c-path: /usr/bin/gcc-9, cpp-path: /usr/bin/g++-9 } | |
- { id: gcc-10, name: gcc, version: 10, c-path: /usr/bin/gcc-10, cpp-path: /usr/bin/g++-10 } | |
- { id: gcc-11, name: gcc, version: 11, c-path: /usr/bin/gcc-11, cpp-path: /usr/bin/g++-11 } | |
- { id: gcc-13, name: gcc, version: 13, c-path: /usr/bin/gcc-13, cpp-path: /usr/bin/g++-13 } | |
- { id: clang-13, name: clang, version: 13, c-path: /usr/bin/clang-13, cpp-path: /usr/bin/clang++-13 } | |
- { id: clang-15, name: clang, version: 15, c-path: /usr/bin/clang-15, cpp-path: /usr/bin/clang++-15 } | |
- { id: clang-16, name: clang, version: 16, c-path: /usr/bin/clang-16, cpp-path: /usr/bin/clang++-16, | |
install: True } | |
- { id: clang-17, name: clang, version: 17, c-path: /usr/bin/clang-17, cpp-path: /usr/bin/clang++-17, | |
install: True } | |
build-type: | |
- { id: debug, conan-name: Debug, conan-preset: debug, } | |
- { id: release, conan-name: Release, conan-preset: release } | |
- { id: relwithdebinfo-tsan, conan-name: RelWithDebInfo, conan-preset: relwithdebinfo, | |
conan-cxxflags: [ "'-fsanitize=thread'" ], conan-cflags: [ "'-fsanitize=thread'" ], | |
conan-ldflags: [ "'-fsanitize=thread'" ] } | |
- { id: relwithdebinfo, conan-name: RelWithDebInfo, conan-preset: relwithdebinfo } | |
- { id: minsizerel, conan-name: MinSizeRel, conan-preset: minsizerel } | |
exclude: | |
- compiler: { id: gcc-9 } | |
build-type: { id: relwithdebinfo-tsan } | |
- compiler: { id: gcc-10 } | |
build-type: { id: relwithdebinfo-tsan } | |
- compiler: { id: gcc-11 } | |
build-type: { id: relwithdebinfo-tsan } | |
- compiler: { id: gcc-13 } | |
build-type: { id: relwithdebinfo-tsan } | |
runs-on: ubuntu-latest | |
name: | | |
build-${{ matrix.compiler.id }}-${{ matrix.build-type.id }} | |
steps: | |
- name: Checkout `flow` repository | |
uses: actions/checkout@v4 | |
- name: Update available software list for apt-get | |
run: sudo apt-get update | |
- name: Install clang compiler | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod u+x llvm.sh | |
sudo ./llvm.sh ${{ matrix.compiler.version }} | |
if: | | |
matrix.compiler.install && matrix.compiler.name == 'clang' | |
- name: Install gcc compiler | |
run: | | |
sudo apt-get install -y software-properties-common | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
sudo apt-get update | |
sudo apt-get install -y gcc-${{ matrix.compiler.version }} g++-${{ matrix.compiler.version }} | |
if: | | |
matrix.compiler.install && matrix.compiler.name == 'gcc' | |
- name: Install the latest version of Conan which is less than 2 | |
run: | | |
pip install "conan<2" | |
- name: Create Conan profile | |
run: | | |
cat <<EOF > conan_profile | |
[settings] | |
compiler = ${{ matrix.compiler.name }} | |
compiler.version = ${{ matrix.compiler.version }} | |
compiler.cppstd = 17 | |
# TODO: Consider testing with LLVM-libc++ also (with clang anyway). | |
compiler.libcxx = libstdc++11 | |
arch = x86_64 | |
os = Linux | |
build_type = ${{ matrix.build-type.conan-name }} | |
[conf] | |
tools.build:compiler_executables = {"c": "${{ matrix.compiler.c-path }}", "cpp": "${{ matrix.compiler.cpp-path }}"} | |
tools.build:cflags = [ ${{ join(matrix.build-type.conan-cflags) }} ] | |
tools.build:cxxflags = [ ${{ join(matrix.build-type.conan-cxxflags) }} ] | |
tools.build:ldflags = [ ${{ join(matrix.build-type.conan-ldflags) }} ] | |
tools.env.virtualenv:auto_use = True | |
[buildenv] | |
CC = ${{ matrix.compiler.c-path }} | |
CXX = ${{ matrix.compiler.cpp-path }} | |
[options] | |
flow:build = True | |
flow:doc = False | |
EOF | |
- name: Install Flow dependencies with Conan using the profile | |
run: | | |
conan install \ | |
. \ | |
--profile:build=conan_profile \ | |
--profile:host=conan_profile \ | |
--build=missing | |
- name: Get the number of processor cores for parallelized work | |
uses: SimenB/github-actions-cpu-cores@v1 | |
id: cpu-cores | |
- name: Prepare Makefile using CMake | |
run: | | |
cmake \ | |
--preset ${{ matrix.build-type.conan-preset }} \ | |
-DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install/${{ matrix.build-type.conan-name }} | |
- name: Build targets (library, demos/tests) with Makefile | |
run: | | |
VERBOSE=1 make \ | |
--keep-going \ | |
--directory $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }} \ | |
-j${{ steps.cpu-cores.outputs.count }} | |
- name: Install targets with Makefile | |
run: | | |
VERBOSE=1 make install \ | |
--directory $GITHUB_WORKSPACE/build/${{ matrix.build-type.conan-name }} \ | |
-j${{ steps.cpu-cores.outputs.count }} | |
- name: Run demo/test [NetFlow echo] | |
run: | | |
cd $GITHUB_WORKSPACE/install/${{ matrix.build-type.conan-name }}/bin/ | |
./net_flow_echo_srv.exec 8888 localhost & | |
sleep 1 | |
./net_flow_echo_cli.exec 1 127.0.01 8888 "Hello world!" | |
echo "Server will print exception due to SIGTERM interruption; that is fine." | |
kill `pidof $PWD/net_flow_echo_srv.exec` | |
if: | | |
matrix.build-type.id != 'relwithdebinfo-tsan' |