Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.24 KiB
Newer Older
# Compilation of scord and execution of tests

Ramon Nou's avatar
Ramon Nou committed
image: bscstorage/scord:0.2.0-wip

stages:
  - build
  - test

build:
  stage: build
  script:
    - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
    - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
    - mkdir -p build
    - cd build
Alberto Miranda's avatar
Alberto Miranda committed
    - cmake
      -DCMAKE_BUILD_TYPE:STRING=ASan
Alberto Miranda's avatar
Alberto Miranda committed
      -DCMAKE_PREFIX_PATH:STRING=/usr/local
      -DCMAKE_INSTALL_PREFIX:STRING=${CI_PROJECT_DIR}/compiled
      -DSCORD_BUILD_EXAMPLES:BOOL=ON
      -DSCORD_BUILD_TESTS:BOOL=ON
Alberto Miranda's avatar
Alberto Miranda committed
      -DSCORD_TRANSPORT_LIBRARY=libfabric
      -DSCORD_TRANSPORT_PROTOCOL=ofi+tcp
      -DSCORD_BIND_ADDRESS=127.0.0.1
      -DSCORD_BIND_PORT=52000
      ..
    - make -j$(nproc) install
  artifacts:
    paths:
      - compiled/bin/
      - compiled/etc/
Alberto Miranda's avatar
Alberto Miranda committed
      - compiled/lib/
      - build/examples/
Alberto Miranda's avatar
Alberto Miranda committed
      - build/tests/
Alberto Miranda's avatar
Alberto Miranda committed
      - build/src/scord/scord
      - build/src/scord-ctl/scord-ctl
      # depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
  cache:
    key: $CI_COMMIT_REF_SLUG
    paths:
      - build/
      - compiled/bin
      - compiled/etc

Alberto Miranda's avatar
Alberto Miranda committed
# run RPC tests using the binary built before
rpc:
  stage: test
  needs: [build]
  script:
    - export ASAN_OPTIONS=detect_odr_violation=0:detect_leaks=0
    - export LSAN_OPTIONS=verbosity=1:log_threads=1:suppressions=${CI_PROJECT_DIR}/tests/LSanSuppress.supp
Alberto Miranda's avatar
Alberto Miranda committed
    - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib
    - cd build/examples/
Alberto Miranda's avatar
Alberto Miranda committed
    - ctest -j$(nproc) --output-on-failure --output-junit rpc-report.xml
  artifacts:
    expire_in: 1 week
    paths:
Alberto Miranda's avatar
Alberto Miranda committed
      - build/examples/rpc-report.xml
Alberto Miranda's avatar
Alberto Miranda committed
      junit: build/examples/rpc-report.xml
Alberto Miranda's avatar
Alberto Miranda committed

# run unit tests
unit:
  stage: test
  needs: [build]
  script:
    - export ASAN_OPTIONS=detect_odr_violation=0
    - export LSAN_OPTIONS=verbosity=1:log_threads=1:suppressions=${CI_PROJECT_DIR}/tests/LSanSuppress.supp
Alberto Miranda's avatar
Alberto Miranda committed
    - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib
    - cd build/tests
Alberto Miranda's avatar
Alberto Miranda committed
    - ctest -j$(nproc) --output-on-failure --output-junit unit-report.xml
Alberto Miranda's avatar
Alberto Miranda committed
  artifacts:
    expire_in: 1 week
    paths:
Alberto Miranda's avatar
Alberto Miranda committed
      - build/tests/unit-report.xml
Alberto Miranda's avatar
Alberto Miranda committed
    reports:
Alberto Miranda's avatar
Alberto Miranda committed
      junit: build/tests/unit-report.xml