Commit 1d6ccfd1 authored by Ramon Nou's avatar Ramon Nou
Browse files

Merge branch 'rnou7310-use-ccache-in-the-ci' into 'master'

Draft: Resolve "Use ccache in the ci"

Closes #310

See merge request !204
parents 3996ad84 6d76561b
Loading
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ variables:
  LIBGKFS_LOG:                  "all"
  LIBGKFS_LOG_OUTPUT:           "${CI_PROJECT_DIR}/logs/gkfs_client.log"
  GIT_SUBMODULE_STRATEGY:       recursive
  CCACHE_DIR:                   "$CI_PROJECT_DIR/ccache"


# base image
image: gekkofs/core:0.9.4-dev
@@ -55,8 +57,13 @@ gkfs:
    - sed -i 's/constexpr auto use_mtime = false;/constexpr auto use_mtime = true;/g' "${CI_PROJECT_DIR}/include/config.hpp"
    - sed -i 's/constexpr auto use_link_cnt = false;/constexpr auto use_link_cnt = true;/g' "${CI_PROJECT_DIR}/include/config.hpp"
    - sed -i 's/constexpr auto use_blocks = false;/constexpr auto use_blocks = true;/g' "${CI_PROJECT_DIR}/include/config.hpp"
      # use ccache
    - ccache --zero-stats
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cmake --preset ci-coverage -DCOVERAGE_OUTPUT_DIR=${COVERAGE_PATH}
    - cmake --build ${BUILD_PATH} -j $(nproc) --target install
    - ccache --show-stats
    # reduce artifacts size
    - ${CI_SCRIPTS_DIR}/trim_build_artifacts.sh ${BUILD_PATH}
  artifacts:
@@ -64,6 +71,10 @@ gkfs:
      - ${BUILD_PATH}
      - ${INSTALL_PATH}
    expire_in: 1 week
  cache:
    key: ccache-gekko
    paths:
      - $CCACHE_DIR

################################################################################
## Testing
@@ -108,6 +119,9 @@ gkfs:integration:
    ## capture coverage information for this test and write it to
    ## $COVERAGE_PATH/$SUBTEST.info
    - cd ${CI_PROJECT_DIR}
    # use ccache
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cmake --preset ci-coverage
          -DCOVERAGE_OUTPUT_DIR=${COVERAGE_PATH}
          -DCOVERAGE_CAPTURE_TRACEFILE=${COVERAGE_PATH}/${SUBTEST}.info
@@ -158,6 +172,9 @@ gkfwd:integration:
    ## capture coverage information for this test and write it to
    ## $COVERAGE_PATH/$SUBTEST.info
    - cd ${CI_PROJECT_DIR}
    # use ccache
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cmake --preset ci-coverage
          -DCOVERAGE_OUTPUT_DIR=${COVERAGE_PATH}
          -DCOVERAGE_CAPTURE_TRACEFILE=${COVERAGE_PATH}/${SUBTEST}.info
@@ -202,6 +219,9 @@ gkfs:unit:
    ## capture coverage information for this test and write it to
    ## $COVERAGE_PATH/unit.info
    - cd ${CI_PROJECT_DIR}
        # use ccache
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cmake --preset ci-coverage
          -DCOVERAGE_OUTPUT_DIR=${COVERAGE_PATH}
          -DCOVERAGE_CAPTURE_TRACEFILE=${COVERAGE_PATH}/unit.info
@@ -240,6 +260,9 @@ documentation:
      when: always

  script:
    # use ccache
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cmake --preset ci-docs
    - cmake --build ${BUILD_PATH} --target docs
  artifacts:
@@ -262,6 +285,10 @@ coverage:baseline:
  script:
    ## capture initial coverage information to establish a baseline
    ## and write it to $COVERAGE_PATH/zerocount.info
    # use ccache
    - ccache --zero-stats
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cd ${CI_PROJECT_DIR}
    - cmake --preset ci-coverage
      -DCOVERAGE_OUTPUT_DIR=${COVERAGE_PATH}
@@ -286,6 +313,10 @@ coverage:
#           'gkfs:unit' ]
  needs: [ 'coverage:baseline', 'gkfs:integration', 'gkfs:unit', 'gkfwd:integration']
  script:
      # use ccache
    - ccache --zero-stats
    - /usr/sbin/update-ccache-symlinks
    - export PATH="/usr/lib/ccache:$PATH"
    - cd ${CI_PROJECT_DIR}
    - cmake
          --preset ci-coverage
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ RUN apt-get update && \
		libcapstone-dev \
		# GekkoFS dependencies
		libboost-program-options-dev \
		uuid-dev && \
		uuid-dev ccache && \
    # install cmake 3.14+ since it's needed for some dependencies
    curl -OL https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-Linux-x86_64.sh && \
    chmod u+x ./cmake-3.25.2-Linux-x86_64.sh && \