From ae75a40f17ebdad6961cb4e6555b1288a8b96ba2 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Thu, 14 Jan 2021 13:06:28 +0100 Subject: [PATCH 1/8] Initial GitHub Actions CPP ProtoBuf Build Signed-off-by: Pierre R. Mai --- .github/workflows/protobuf.yml | 49 ++++++++++ .travis.yml | 161 --------------------------------- 2 files changed, 49 insertions(+), 161 deletions(-) create mode 100644 .github/workflows/protobuf.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml new file mode 100644 index 000000000..009c8e5dd --- /dev/null +++ b/.github/workflows/protobuf.yml @@ -0,0 +1,49 @@ +name: ProtoBuf CI Builds + +on: + push: + pull_request: + branches: [ master ] + +jobs: + build-cpp-linux64: + name: Build C++ Linux 64 + + runs-on: ubuntu-18.04 + + steps: + - name: Checkout OSI + uses: actions/checkout@v2 + with: + submodules: true + + - name: Cache Dependencies + id: cache-depends + uses: actions/cache@v2 + with: + path: protobuf-3.11.3 + key: ${{ runner.os }}-v1-depends + + - name: Download ProtoBuf + if: steps.cache-depends.outputs.cache-hit != 'true' + run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.3/protobuf-all-3.11.3.tar.gz && tar xzvf protobuf-all-3.11.3.tar.gz + + - name: Build ProtoBuf + if: steps.cache-depends.outputs.cache-hit != 'true' + working-directory: protobuf-3.11.3 + run: ./configure DIST_LANG=cpp --prefix=/usr && make + + - name: Install ProtoBuf + working-directory: protobuf-3.11.3 + run: sudo make install && sudo ldconfig + + - name: Prepare Build + run: mkdir build + + - name: Configure Build + working-directory: build + run: cmake .. + + - name: Build + working-directory: build + run: cmake --build . --config Release -j 4 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d7c1215ce..000000000 --- a/.travis.yml +++ /dev/null @@ -1,161 +0,0 @@ -# Source: https://github.com/boostorg/hana/blob/master/.travis.yml - -# Use distribution Ubuntu 18.04 Bionic -dist: bionic - -# Use C++ build environment. -language: cpp - -# Protobuf requires g++ (see https://github.com/google/protobuf/blob/master/src/README.md) -compiler: - - gcc - -# Cache dependencies to speed up the build. -cache: - directories: - - ${HOME}/deps/cmake - - ${HOME}/deps/protobuf -# - ${HOME}/deps/proto2cpp - -# Handle dependencies in separate directory. -before_install: - - TESTINST_DIR="${HOME}/dummy" - - mkdir -p "${TESTINST_DIR}" - - DEPS_DIR="${HOME}/deps" - - mkdir -p "${DEPS_DIR}" - - cd "${DEPS_DIR}" - -# Install necessary packages. -install: - # Install a recent version of CMake - - | - CMAKE_URL="https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz" - if [ ! -f ${DEPS_DIR}/cmake/bin/cmake ] ; then mkdir -p cmake ; travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake ; fi - export PATH=${DEPS_DIR}/cmake/bin:${PATH} - - # Install a recent version of the Protobuf - - | - PROTOBUF_URL="https://github.com/google/protobuf/releases/download/v3.2.0/protobuf-cpp-3.2.0.tar.gz" - if [ ! -f ${DEPS_DIR}/protobuf/install/bin/protoc ] ; then mkdir -p protobuf ; travis_retry wget --no-check-certificate --quiet -O - ${PROTOBUF_URL} | tar --strip-components=1 -xz -C protobuf ; cd protobuf ; ./configure --prefix=${DEPS_DIR}/protobuf/install ; make ; make install ; fi - export PATH=${DEPS_DIR}/protobuf/install/bin:${PATH} - - # Install proto2cpp for doxygen - - | - PROTO2CPP_URL="https://github.com/OpenSimulationInterface/proto2cpp.git" - if [ ! -f ${DEPS_DIR}/proto2cpp ] ; then mkdir -p proto2cpp ; git clone ${PROTO2CPP_URL} ${DEPS_DIR}/proto2cpp ; fi - -# Environment variables. -env: - global: - - GH_REPO_ORG=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 1` - - GH_REPO_NAME=`echo $TRAVIS_REPO_SLUG | cut -d "/" -f 2` - - GH_REPO_REF="github.com/$GH_REPO_ORG/$GH_REPO_NAME.git" - -# Addons necessary for documentation. -addons: - apt: - packages: - - doxygen - - doxygen-doc - - doxygen-latex - - doxygen-gui - - graphviz - - python3-setuptools - - python3-pip - - python3-wheel - - -jobs: - include: - # Run the build script and generate documentation. - - stage: test OSI protobuf - - name: 'Test protobuf 2.6.1 syntax' - script: - - cd "${TRAVIS_BUILD_DIR}" - - mkdir -p build - - cd build - - cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install -D CMAKE_INSTALL_PREFIX:PATH=${TESTINST_DIR} .. - - cmake --build . - - cd .. - - python3 setup.py build - - python3 setup.py sdist - - python3 -m pip install -U pip - - python3 -m pip install . - - cd build - - cmake --build . --target install - - cd .. - - cp VERSION VERSION.SAVED - - echo "" >> VERSION - - echo "VERSION_PATCH = \"GitHub_MasterBranch\"" >> VERSION - - cd build - - cmake -D FILTER_PROTO2CPP_PY_PATH=${DEPS_DIR}/proto2cpp .. - - echo "EXCLUDE_PATTERNS = */osi3/*" >> Doxyfile - - echo "GENERATE_TREEVIEW = YES" >> Doxyfile - - doxygen - - cd .. - - python3 -m unittest discover tests - - - script: - - cd "${TRAVIS_BUILD_DIR}" - - bash convert-to-proto3.sh - - rm *.pb2 - - mkdir -p build - - cd build - - cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install -D CMAKE_INSTALL_PREFIX:PATH=${TESTINST_DIR} .. - - cmake --build . - - cd .. - - python3 setup.py build - - python3 setup.py sdist - - python3 -m pip install -U pip - - python3 -m pip install . - - cd build - - cmake --build . --target install - - cd .. - - cp VERSION VERSION.SAVED - - echo "" >> VERSION - - echo "VERSION_PATCH = \"GitHub_MasterBranch\"" >> VERSION - - cd build - - cmake -D FILTER_PROTO2CPP_PY_PATH=${DEPS_DIR}/proto2cpp .. - - echo "EXCLUDE_PATTERNS = */osi3/*" >> Doxyfile - - echo "GENERATE_TREEVIEW = YES" >> Doxyfile - - doxygen - - cd .. - - python3 -m unittest discover tests - name: 'Test protobuf 3.0.0 syntax' - - - stage: deploy - script: - - cd "${TRAVIS_BUILD_DIR}" - - mkdir -p build - - cd build - - cmake -D CMAKE_PREFIX_PATH:PATH=${DEPS_DIR}/protobuf/install -D CMAKE_INSTALL_PREFIX:PATH=${TESTINST_DIR} .. - - cmake --build . - - cd .. - - python3 setup.py build - - python3 setup.py sdist - - python3 -m pip install -U pip - - python3 -m pip install . - - cd build - - cmake --build . --target install - - cd .. - - cp VERSION VERSION.SAVED - - echo "" >> VERSION - - echo "VERSION_PATCH = \"GitHub_MasterBranch\"" >> VERSION - - cd build - - cmake -D FILTER_PROTO2CPP_PY_PATH=${DEPS_DIR}/proto2cpp .. - - echo "EXCLUDE_PATTERNS = */osi3/*" >> Doxyfile - - echo "GENERATE_TREEVIEW = YES" >> Doxyfile - - doxygen - - cd .. - - python3 -m unittest discover tests - - # Deploy the documentation on github (only for master branch). - deploy: - provider: pages - skip_cleanup: true - local_dir: doc/html - keep-history: true - github_token: ${GH_REPO_TOKEN} - on: - branch: master From 72a2ba1f346064bfe180284d2aee0e954018482d Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Thu, 14 Jan 2021 17:57:15 +0100 Subject: [PATCH 2/8] Add Python ProtoBuf build Signed-off-by: Pierre R. Mai --- .github/workflows/protobuf.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index 009c8e5dd..09c348b4e 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -6,8 +6,8 @@ on: branches: [ master ] jobs: - build-cpp-linux64: - name: Build C++ Linux 64 + build-proto2-linux64: + name: Build Proto2 Linux 64 runs-on: ubuntu-18.04 @@ -17,6 +17,14 @@ jobs: with: submodules: true + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Install Python Dependencies + run: python -m pip install --upgrade pip setuptools wheel pyyaml + - name: Cache Dependencies id: cache-depends uses: actions/cache@v2 @@ -37,13 +45,23 @@ jobs: working-directory: protobuf-3.11.3 run: sudo make install && sudo ldconfig - - name: Prepare Build + - name: Prepare C++ Build run: mkdir build - - name: Configure Build + - name: Configure C++ Build working-directory: build run: cmake .. - - name: Build + - name: Build C++ working-directory: build run: cmake --build . --config Release -j 4 + + - name: Build Python + run: python setup.py build && python setup.py sdist + + - name: Install Python + run: python -m pip install . + + - name: Run Python Tests + run: python -m unittest discover tests + From ff2ef96757954b800831408ce6701170edecae39 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Thu, 14 Jan 2021 23:45:06 +0100 Subject: [PATCH 3/8] Add documentation generation Signed-off-by: Pierre R. Mai --- .github/workflows/protobuf.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index 09c348b4e..900e30282 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -25,6 +25,9 @@ jobs: - name: Install Python Dependencies run: python -m pip install --upgrade pip setuptools wheel pyyaml + - name: Install Doxygen + run: sudo apt-get install doxygen graphviz + - name: Cache Dependencies id: cache-depends uses: actions/cache@v2 @@ -45,12 +48,20 @@ jobs: working-directory: protobuf-3.11.3 run: sudo make install && sudo ldconfig + - name: Install proto2cpp + run: git clone --depth 1 https://github.com/OpenSimulationInterface/proto2cpp.git + - name: Prepare C++ Build run: mkdir build + - name: Prepare Documentation Bukd + run: | + echo "EXCLUDE_PATTERNS = */osi3/* */protobuf-3.11.3/* */proto2cpp/*" >> doxygen_config.cmake.in + echo "GENERATE_TREEVIEW = YES" >> doxygen_config.cmake.in + - name: Configure C++ Build working-directory: build - run: cmake .. + run: cmake -D FILTER_PROTO2CPP_PY_PATH=$GITHUB_WORKSPACE/proto2cpp .. - name: Build C++ working-directory: build @@ -65,3 +76,10 @@ jobs: - name: Run Python Tests run: python -m unittest discover tests + - name: Archive Documentation + uses: actions/upload-artifact@v2 + with: + name: linux64-doc + path: doc/html + if-no-files-found: error + From 33c4e2b3fa3a17c6840a489d23be2ff221816fa9 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Fri, 15 Jan 2021 01:24:01 +0100 Subject: [PATCH 4/8] Add Proto3 Test Builds Signed-off-by: Pierre R. Mai --- .github/workflows/protobuf.yml | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index 900e30282..667893416 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -83,3 +83,66 @@ jobs: path: doc/html if-no-files-found: error + build-proto3-linux64: + name: Build Proto3 Linux 64 + + runs-on: ubuntu-18.04 + + steps: + - name: Checkout OSI + uses: actions/checkout@v2 + with: + submodules: true + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + + - name: Install Python Dependencies + run: python -m pip install --upgrade pip setuptools wheel pyyaml + + - name: Cache Dependencies + id: cache-depends + uses: actions/cache@v2 + with: + path: protobuf-3.11.3 + key: ${{ runner.os }}-v1-depends + + - name: Download ProtoBuf + if: steps.cache-depends.outputs.cache-hit != 'true' + run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.3/protobuf-all-3.11.3.tar.gz && tar xzvf protobuf-all-3.11.3.tar.gz + + - name: Build ProtoBuf + if: steps.cache-depends.outputs.cache-hit != 'true' + working-directory: protobuf-3.11.3 + run: ./configure DIST_LANG=cpp --prefix=/usr && make + + - name: Install ProtoBuf + working-directory: protobuf-3.11.3 + run: sudo make install && sudo ldconfig + + - name: Prepare C++ Build + run: mkdir build + + - name: Switch to Proto3 Syntax + run: | + bash convert-to-proto3.sh + rm *.pb2 + + - name: Configure C++ Build + working-directory: build + run: cmake .. + + - name: Build C++ + working-directory: build + run: cmake --build . --config Release -j 4 + + - name: Build Python + run: python setup.py build && python setup.py sdist + + - name: Install Python + run: python -m pip install . + + - name: Run Python Tests + run: python -m unittest discover tests From 1cb802fc78f005ccd11cd339b30f4101406f8840 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Fri, 15 Jan 2021 01:24:13 +0100 Subject: [PATCH 5/8] Adjust version number for Doxygen documentation Signed-off-by: Pierre R. Mai --- .github/workflows/protobuf.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index 667893416..e00487d16 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -56,6 +56,7 @@ jobs: - name: Prepare Documentation Bukd run: | + sed -i 's/@VERSION_PATCH@/@VERSION_PATCH@_GitHub_MasterBranch/g' doxygen_config.cmake.in echo "EXCLUDE_PATTERNS = */osi3/* */protobuf-3.11.3/* */proto2cpp/*" >> doxygen_config.cmake.in echo "GENERATE_TREEVIEW = YES" >> doxygen_config.cmake.in From 707d4f896d6da32c49e1827fbf9307ad88084351 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Fri, 15 Jan 2021 01:58:38 +0100 Subject: [PATCH 6/8] Update Build status badge to GitHub Actions CI Signed-off-by: Pierre R. Mai --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e032250e..bf47eed8c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Open Simulation Interface (OSI) =============================== -[![Travis Build Status](https://travis-ci.com/OpenSimulationInterface/open-simulation-interface.svg?branch=master)](https://travis-ci.com/OpenSimulationInterface/open-simulation-interface) +[![GitHub Build Status](https://github.com/pmai/open-simulation-interface/workflows/ProtoBuf%20CI%20Builds/badge.svg)](https://github.com/pmai/open-simulation-interface/actions?query=workflow%3A%22ProtoBuf+CI+Builds%22) The Open Simulation Interface [[1]](https://www.hot.ei.tum.de/forschung/automotive-veroeffentlichungen/) (OSI) is a generic interface based on [Google's protocol buffers](https://developers.google.com/protocol-buffers/) for the environmental perception of automated driving functions in virtual scenarios. From 62365c32f5f4a0804d1f6920349ca2e249e8a14e Mon Sep 17 00:00:00 2001 From: Stefan Cyliax Date: Mon, 26 Apr 2021 08:24:49 +0200 Subject: [PATCH 7/8] added deploy to gh-pages and update to current protobuf version Signed-off-by: Stefan Cyliax --- .github/workflows/protobuf.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/protobuf.yml b/.github/workflows/protobuf.yml index e00487d16..11b52d5ff 100644 --- a/.github/workflows/protobuf.yml +++ b/.github/workflows/protobuf.yml @@ -32,20 +32,20 @@ jobs: id: cache-depends uses: actions/cache@v2 with: - path: protobuf-3.11.3 + path: protobuf-3.15.8 key: ${{ runner.os }}-v1-depends - name: Download ProtoBuf if: steps.cache-depends.outputs.cache-hit != 'true' - run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.3/protobuf-all-3.11.3.tar.gz && tar xzvf protobuf-all-3.11.3.tar.gz + run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protobuf-all-3.15.8.tar.gz && tar xzvf protobuf-all-3.15.8.tar.gz - name: Build ProtoBuf if: steps.cache-depends.outputs.cache-hit != 'true' - working-directory: protobuf-3.11.3 + working-directory: protobuf-3.15.8 run: ./configure DIST_LANG=cpp --prefix=/usr && make - name: Install ProtoBuf - working-directory: protobuf-3.11.3 + working-directory: protobuf-3.15.8 run: sudo make install && sudo ldconfig - name: Install proto2cpp @@ -57,7 +57,7 @@ jobs: - name: Prepare Documentation Bukd run: | sed -i 's/@VERSION_PATCH@/@VERSION_PATCH@_GitHub_MasterBranch/g' doxygen_config.cmake.in - echo "EXCLUDE_PATTERNS = */osi3/* */protobuf-3.11.3/* */proto2cpp/*" >> doxygen_config.cmake.in + echo "EXCLUDE_PATTERNS = */osi3/* */protobuf-3.15.8/* */proto2cpp/*" >> doxygen_config.cmake.in echo "GENERATE_TREEVIEW = YES" >> doxygen_config.cmake.in - name: Configure C++ Build @@ -78,12 +78,20 @@ jobs: run: python -m unittest discover tests - name: Archive Documentation + if: ${{ github.event_name == 'pull_request' }} uses: actions/upload-artifact@v2 with: name: linux64-doc path: doc/html if-no-files-found: error + - name: deploy to gh-pages if push to master branch + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/html + build-proto3-linux64: name: Build Proto3 Linux 64 @@ -107,20 +115,20 @@ jobs: id: cache-depends uses: actions/cache@v2 with: - path: protobuf-3.11.3 + path: protobuf-3.15.8 key: ${{ runner.os }}-v1-depends - name: Download ProtoBuf if: steps.cache-depends.outputs.cache-hit != 'true' - run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.11.3/protobuf-all-3.11.3.tar.gz && tar xzvf protobuf-all-3.11.3.tar.gz + run: curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protobuf-all-3.15.8.tar.gz && tar xzvf protobuf-all-3.15.8.tar.gz - name: Build ProtoBuf if: steps.cache-depends.outputs.cache-hit != 'true' - working-directory: protobuf-3.11.3 + working-directory: protobuf-3.15.8 run: ./configure DIST_LANG=cpp --prefix=/usr && make - name: Install ProtoBuf - working-directory: protobuf-3.11.3 + working-directory: protobuf-3.15.8 run: sudo make install && sudo ldconfig - name: Prepare C++ Build From 1489f9a1ac0f9d056553938fcc3ff588d750619c Mon Sep 17 00:00:00 2001 From: Stefan Cyliax Date: Mon, 26 Apr 2021 09:42:25 +0200 Subject: [PATCH 8/8] preparation of badge address to target repo Signed-off-by: Stefan Cyliax --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf47eed8c..6053ce638 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Open Simulation Interface (OSI) =============================== -[![GitHub Build Status](https://github.com/pmai/open-simulation-interface/workflows/ProtoBuf%20CI%20Builds/badge.svg)](https://github.com/pmai/open-simulation-interface/actions?query=workflow%3A%22ProtoBuf+CI+Builds%22) +[![ProtoBuf CI Builds](https://github.com/OpenSimulationInterface/open-simulation-interface/actions/workflows/protobuf.yml/badge.svg)](https://github.com/OpenSimulationInterface/open-simulation-interface/actions/workflows/protobuf.yml) The Open Simulation Interface [[1]](https://www.hot.ei.tum.de/forschung/automotive-veroeffentlichungen/) (OSI) is a generic interface based on [Google's protocol buffers](https://developers.google.com/protocol-buffers/) for the environmental perception of automated driving functions in virtual scenarios.