Merge pull request #12 from Telecominfraproject/mux

- mux: update the TAI submodule
- ci: move to github action
This commit is contained in:
Wataru Ishida
2020-10-21 11:12:10 -07:00
committed by GitHub
6 changed files with 26 additions and 18 deletions

16
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: ci
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: crazy-max/ghaction-docker-buildx@v1
- uses: actions/checkout@v2
with:
submodules: true
- run: make -C tai_mux builder
- run: TAI_DOCKER_RUN_OPTION='--rm' TAI_DOCKER_CMD='make test' make -C tai_mux cmd

View File

@@ -1,12 +0,0 @@
sudo: required
language: cpp # we run all tests in docker container so this can be anything
services:
- docker
before_install:
- make -C tai_mux docker-image
script:
- TAI_DOCKER_CMD='make test' make -C tai_mux cmd

View File

@@ -24,6 +24,10 @@ ifndef TAI_MUX_BUILDDIR
TAI_MUX_BUILDDIR := build
endif
ifndef TAI_DOCKER_RUN_OPTION
TAI_DOCKER_RUN_OPTION := -it --rm
endif
CFLAGS := -std=c++17 -g3 -shared -fPIC -DTAI_EXPOSE_PLATFORM -fno-gnu-unique
INCLUDES := -I $(TAI_DIR)/inc -I $(TAI_DIR)/meta -I $(TAI_LIB_DIR) -I $(TAI_FRAMEWORK_DIR) -include mux.hpp
@@ -34,7 +38,7 @@ HEADERS := $(wildcard *.hpp $(TAI_LIB_DIR)/*.hpp $(TAI_FRAMEWORK_DIR)/*.hpp)
OBJECTS := $(addprefix $(BUILDDIR)/,$(SOURCES:%.cpp=%.o))
DEPS := $(addprefix $(BUILDDIR)/,$(SOURCES:%.cpp=%.d))
.PHONY = all meta test cmd docker docker-image bash clean clean-all
.PHONY = all meta test cmd docker builder bash clean clean-all
all: $(PROG)
@@ -56,12 +60,12 @@ test:
$(MAKE) -C tests
cmd:
TAI_DOCKER_CMD="$(TAI_DOCKER_CMD)" TAI_DOCKER_RUN_OPTION="--privileged --net=host -it --rm" TAI_DOCKER_MOUNT="`pwd`:/data" $(MAKE) -C $(TAI_DIR) $@
TAI_DOCKER_MOUNT="`pwd`:/data" $(MAKE) -C $(TAI_DIR) $@
docker:
TAI_DOCKER_CMD="make" $(MAKE) cmd
docker-image:
builder:
$(MAKE) -C $(TAI_DIR) $@
bash:

View File

@@ -41,7 +41,7 @@ namespace tai::mux {
m_pa = std::make_shared<StaticPlatformAdapter>(0, services);
break;
default:
ERROR("unsupported platform_adapter: %s", pa_name.c_str());
TAI_ERROR("unsupported platform_adapter: %s", pa_name.c_str());
throw Exception(TAI_STATUS_NOT_SUPPORTED);
}
}

View File

@@ -27,7 +27,7 @@ namespace tai::mux {
auto dst = std::make_shared<Attribute>(meta, src);
auto ret = convert_oid(ctx->object_type, oid, dst, dst, true);
if ( ret != TAI_STATUS_SUCCESS ) {
ERROR("failed to convert oid of attribute: %d", src.id);
TAI_ERROR("failed to convert oid of attribute: %d", src.id);
continue;
}
attrs.emplace_back(dst);