Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 14 additions & 36 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,39 @@ version: 2.1

jobs:
build-linux-gcc:
machine:
machine:
image: ubuntu-2004:202111-02
steps:
- checkout
- run: sudo apt-get update -qq
- run: sudo apt-get install python3 bison flex libboost-dev libboost-filesystem-dev libboost-system-dev gcc g++
- run: sudo pip3 install pytest pyyaml enum34 pyserial
- run: CC=gcc CXX=g++ PYTHON=python3 make all
- run: pushd erpcgen/test ; py.test ; popd
- run: python3 test/run_unit_tests.py
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
- run: chmod u+x run_tests.sh && ./run_tests.sh
build-linux-clang:
machine:
machine:
image: ubuntu-2004:202111-02
steps:
- checkout
- run: sudo apt-get update -qq
- run: sudo apt-get install python3 bison flex libboost-dev libboost-filesystem-dev libboost-system-dev clang
- run: sudo pip install pytest pyyaml enum34 pyserial
- run: CC=clang CXX=clang++ PYTHON=python3 make all
- run: pushd erpcgen/test ; py.test ; popd
- run: python3 test/run_unit_tests.py
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
- run: chmod u+x run_tests.sh && ./run_tests.sh clang
build-mac-gcc:
macos:
macos:
xcode: 13.2.1
steps:
- checkout
- run: brew update
- run: brew install python3 bison flex -v -f 2>&1 && brew upgrade boost || true
- run: curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" | sudo python3;
- run: sudo pip install tornado
- run: sudo pip install --user nose
- run: sudo pip install pytest --upgrade --ignore-installed six
- run: CC=gcc CXX=g++ PYTHON=python3 make all
- run: pushd erpcgen/test ; py.test ; popd
- run: python3 test/run_unit_tests.py
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh
- run: chmod u+x run_tests.sh && ./run_tests.sh
build-mac-clang:
macos:
macos:
xcode: 13.2.1
steps:
- checkout
- run: brew update
- run: brew install python3 bison flex -v -f 2>&1 && brew upgrade boost || true
- run: curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" | sudo python3;
- run: sudo pip install tornado
- run: sudo pip install --user nose
- run: sudo pip install pytest --upgrade --ignore-installed six
- run: CC=clang CXX=clang++ PYTHON=python3 make all
- run: pushd erpcgen/test ; py.test ; popd
- run: python3 test/run_unit_tests.py
- run: chmod u+x install_dependencies.sh && ./install_dependencies.sh clang
- run: chmod u+x run_tests.sh && ./run_tests.sh clang



workflows:
build-workflow:
jobs:
- build-linux-gcc
- build-linux-clang
# - build-mac-gcc # Mac is on going, or it can be hosted on company computer.
# - build-mac-clang
# - build-mac-clang
30 changes: 30 additions & 0 deletions install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
echo "Linux os detected. Installing dependencies."
sudo apt-get update -qq
sudo apt-get install python3 bison flex libboost-dev libboost-filesystem-dev libboost-system-dev
if [ "$1"="clang" ]; then
echo "Installing clang compiler."
sudo apt-get install clang
else
echo "Installing default gnu compiler."
sudo apt-get install gcc g++
fi
sudo pip3 install pytest pyyaml
;;
Darwin*)
echo "Mac os detected. Installing dependencies."
brew update
brew install python3 bison flex -v -f 2>&1 && brew upgrade boost || true
curl "https://bootstrap.pypa.io/pip/2.7/get-pip.py" | sudo python3
sudo pip install tornado
sudo pip install --user nose
sudo pip install pytest --upgrade --ignore-installed six
;;
*)
echo "Unknown or currently unsupported os: ${unameOut}"
;;
esac
19 changes: 12 additions & 7 deletions mk/paths.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ ERPCGEN ?= $(OUTPUT_ROOT)/$(DEBUG_OR_RELEASE)/$(os_name)/erpcgen/erpcgen
LD := $(CXX)
PYTHON ?= python
ifeq (, $(shell which $(PYTHON)))
PYTHON= python3
PYTHON=python3
ifeq (, $(shell which $(PYTHON)))
$(error "No python found. Please install python3.")
endif
else
ifneq (3, $(shell $(PYTHON) --version | cut -c 8-8))
ifeq (, $(shell which python3))
$(error "Please install python3.")
else
PYTHON=python3
endif
endif
endif

# Tool paths. Use different paths for OS X.
Expand All @@ -71,12 +82,6 @@ else ifeq "$(is_mingw)" "1"
FLEX ?= $(ERPC_ROOT)/erpcgen/VisualStudio_v14/win_flex.exe
BISON ?= $(ERPC_ROOT)/erpcgen/VisualStudio_v14/win_bison.exe
endif
ifeq (, $(shell which $(PYTHON)))
$(error "No python found")
endif
ifneq (3, $(shell $(PYTHON) --version | cut -c 8-8))
$(error "Please install and use Python3")
endif

ifeq "$(is_mingw)" "1"
mkdirc = C:\MinGW\msys\1.0\bin\mkdir.exe
Expand Down
12 changes: 12 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

make clean
if [ "$1"="clang" ]; then
echo "Compiling by clang compiler."
CC=clang CXX=clang++ make all
else
echo "Compiling by default gnu compiler."
CC=gcc CXX=g++ make all
fi
pytest-3 erpcgen/test/
python3 test/run_unit_tests.py