Upgrade to latest here olp sdk release #192
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
# SPDX-FileCopyrightText: Copyright DB Netz AG | |
# SPDX-License-Identifier: CC0-1.0 | |
name: dbs-onboard-map-api CI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- '**' | |
env: | |
IS_MAIN_BRANCH: ${{ github.ref == 'refs/heads/main' }} | |
IMAGE_NAME: dbs-map-mock-server | |
VERSION: latest | |
REGISTRY: ghcr.io | |
REPOSITORY: dsd-dbs/dbs-onboard-map-api | |
PORT: 8080 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout DBS Onboard API code including submodules recursively | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y cmake | |
sudo apt-get install -y gcovr | |
sudo apt-get install libgmock-dev libgtest-dev | |
sudo apt-get install -y rapidjson-dev | |
sudo apt-get install -y doxygen | |
sudo apt-get install libcurl4-openssl-dev protobuf-compiler libprotobuf-dev libboost-all-dev -y --no-install-recommends --fix-missing | |
- name: Login to github container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Pull mock server image | |
run: | | |
docker pull ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | |
- name: Run mock server | |
run: | | |
docker run -d -p ${{ env.PORT }}:${{ env.PORT }} -e PORT=${{ env.PORT }} \ | |
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | |
- name: Build DBS Onboard MAP API sources | |
run: ${{github.workspace}}/scripts/build.sh -DCMAKE_BUILD_TYPE=Debug | |
- name: Run Test | |
run: | | |
${{github.workspace}}/build/dbs-map-api/tests/GoogleTestRunner | |
- name: Generate Test Coverage | |
# if: env.IS_MAIN_BRANCH == 'true' | |
run: | | |
${{github.workspace}}/scripts/code_coverage.sh | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
# if: env.IS_MAIN_BRANCH == 'true' | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ${{github.workspace}}/build/coverage/coverage.xml | |
fail_ci_if_error: true |