Skip to content

Merge pull request #139 from nanocoh/main #567

Merge pull request #139 from nanocoh/main

Merge pull request #139 from nanocoh/main #567

name: naja_app_build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
NAJA_INSTALL: ${{github.workspace}}/naja_install
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install boost & capnproto
# install dependencies
run: sudo apt-get update && sudo apt-get install -yq libboost-dev libfl-dev capnproto libcapnp-dev libtbb-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.NAJA_INSTALL}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j 4 --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -VV -C ${{env.BUILD_TYPE}}
- name: CreateDirs
run: |
mkdir -p ${{env.NAJA_INSTALL}}
mkdir -p ${{github.workspace}}/naja_app
- name: Install
working-directory: ${{github.workspace}}/build
run: make install
- name: CopySnippetApp
working-directory: ${{github.workspace}}/naja_app
run: cp -R ${{github.workspace}}/src/app_snippet .
- name: ConfigureSnippetApp
working-directory: ${{github.workspace}}/naja_app/app_snippet
run: cmake -B ${{github.workspace}}/naja_app/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: BuildSnippetApp
run: cmake --build ${{github.workspace}}/naja_app/build -j 4 --config ${{env.BUILD_TYPE}}
- name: ExecuteSnippetApp
working-directory: ${{github.workspace}}/naja_app/build/src
env:
LD_LIBRARY_PATH: ${{env.LD_LIBRARY_PATH}}:${{env.NAJA_INSTALL}}/lib
run: ./naja_app