Skip to content

Commit

Permalink
Merge pull request #78 from eseiler/infra/misc
Browse files Browse the repository at this point in the history
[INFRA] ccache, fmindex, CI
  • Loading branch information
eseiler committed Mar 15, 2024
2 parents 110c346 + 5c6880e commit b8cfb0f
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 81 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ on:

concurrency:
group: coverage-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
cancel-in-progress: ${{ github.event_name != 'push' }}

env:
SHARG_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

defaults:
Expand All @@ -34,16 +33,10 @@ jobs:
compiler: "gcc-13"

steps:
# How many commits do we need to fetch to also fetch the branch point?
- name: Get fetch depth
id: fetch_depth
run: echo "depth=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> $GITHUB_OUTPUT

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ steps.fetch_depth.outputs.depth }}
submodules: false
fetch-depth: 0

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
Expand All @@ -61,7 +54,7 @@ jobs:
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100
pip install gcovr==6.0
- name: Configure tests
- name: Configure
run: |
mkdir build
cd build
Expand All @@ -70,24 +63,19 @@ jobs:
-DCMAKE_C_FLAGS="--coverage -fprofile-arcs -ftest-coverage -Werror" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-lgcov" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-lgcov"
make -j2 -k gtest_main yaml-cpp
- name: Build tests
- name: Build and run tests
run: |
ccache -z
cd build
make -j2 -k check
ccache -sv
- name: Generate coverage report
run: |
gcovr --gcov-executable ${{ github.workspace }}/.github/workflows/scripts/gcov.sh \
--root ${{ github.workspace }}/test \
--root ${{ github.workspace }} \
${{ github.workspace }}/build \
--filter ${{ github.workspace }}/include \
--filter ${{ github.workspace }}/src \
--exclude-lines-by-pattern '^\s*$' \
--exclude-lines-by-pattern '^\s*};$' \
--exclude-unreachable-branches \
--exclude-throw-branches \
--exclude-noncode-lines \
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ concurrency:
cancel-in-progress: ${{ github.event_name != 'push' }}

env:
SHARG_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

defaults:
Expand All @@ -32,31 +31,24 @@ jobs:
include:
- name: "clang17"
compiler: "clang-17"
build: unit
build_type: Release
cxx_flags: "-stdlib=libc++"

- name: "gcc13"
compiler: "gcc-13"
build: unit
build_type: Release

- name: "gcc12"
compiler: "gcc-12"
build: unit
build_type: Release

- name: "gcc11"
compiler: "gcc-11"
build: unit
build_type: Release

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
Expand All @@ -75,12 +67,6 @@ jobs:
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Werror"
make -j2 -k gtest_main yaml-cpp
- name: Build application
run: |
cd build
make -j2 -k
- name: Build and run tests
run: |
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ concurrency:
cancel-in-progress: ${{ github.event_name != 'push' }}

env:
SHARG_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

defaults:
Expand All @@ -32,31 +31,24 @@ jobs:
include:
- name: "clang17"
compiler: "clang-17"
build: unit
build_type: Release
cxx_flags: "-stdlib=libc++" # For verbosity. This is already the default.

- name: "gcc13"
compiler: "gcc-13"
build: unit
build_type: Release

- name: "gcc12"
compiler: "gcc-12"
build: unit
build_type: Release

- name: "gcc11"
compiler: "gcc-11"
build: unit
build_type: Release

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
Expand All @@ -75,12 +67,6 @@ jobs:
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Werror"
make -j3 -k gtest_main yaml-cpp
- name: Build application
run: |
cd build
make -j3 -k
- name: Build and run tests
run: |
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false

- name: Run clang-format
uses: DoozyX/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ project (app-template
# This allows including `*.cmake` files from the `cmake` directory without specifying the full path.
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

# Use ccache if available. This speeds up the build process by caching files that have been compiled before.
include (ccache)

# Specify the directories where to store the built archives, libraries and executables.
include (output_directories)

# Add packages.
# We use CPM for package management: https://github.com/cpm-cmake/CPM.cmake
# The added packages (hibf, sharg, seqan3) are defined in the `cmake/package-locj.cmake` file.
# The added packages (e.g., hibf, sharg, seqan3) are defined in the `cmake/package-lock.cmake` file.
include (CPM)
CPMUsePackageLock (${CMAKE_CURRENT_LIST_DIR}/cmake/package-lock.cmake)

# Use ccache if available. This speeds up the build process by caching files that have been compiled before.
CPMGetPackage (use_ccache)
CPMGetPackage (hibf)
CPMGetPackage (sharg)
CPMGetPackage (seqan3)
CPMGetPackage (fmindex)

# Add the application. This will include `src/CMakeLists.txt`.
add_subdirectory (src)
Expand Down
28 changes: 0 additions & 28 deletions cmake/ccache.cmake

This file was deleted.

25 changes: 25 additions & 0 deletions cmake/package-lock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ CPMDeclarePackage (hibf
EXCLUDE_FROM_ALL TRUE
OPTIONS "INSTALL_HIBF OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# sharg
set (SHARG_VERSION 01f848eeb6dbac3d50a718a8ee26bcf695edf5a8)
CPMDeclarePackage (sharg
Expand All @@ -25,6 +26,7 @@ CPMDeclarePackage (sharg
EXCLUDE_FROM_ALL TRUE
OPTIONS "INSTALL_SHARG OFF" "INSTALL_TDL OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# seqan3
set (SEQAN3_VERSION fee3fb8e5976b455e848dd68c57f64fd3f67c3c2)
CPMDeclarePackage (seqan3
Expand All @@ -35,6 +37,18 @@ CPMDeclarePackage (seqan3
EXCLUDE_FROM_ALL TRUE
OPTIONS "INSTALL_SEQAN3 OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# fmindex
set (FMINDEX_VERSION 822d4d1aa6fa725f7d34e1ea819e9c23a2b6ebc2)
CPMDeclarePackage (fmindex
NAME fmindex
GIT_TAG ${FMINDEX_VERSION}
GITHUB_REPOSITORY SGSSGene/fmindex-collection
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
OPTIONS "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# googletest
set (GOOGLETEST_VERSION 1.14.0)
CPMDeclarePackage (googletest
Expand All @@ -45,3 +59,14 @@ CPMDeclarePackage (googletest
EXCLUDE_FROM_ALL TRUE
OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# use_ccache
set (USE_CCACHE_VERSION d2a54ef555b6fc2d496a4c9506dbeb7cf899ce37)
CPMDeclarePackage (use_ccache
NAME use_ccache
GIT_TAG ${USE_CCACHE_VERSION}
GITHUB_REPOSITORY seqan/cmake-scripts
SOURCE_SUBDIR ccache
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
)
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ cmake_minimum_required (VERSION 3.25)
# You can add more external include paths of other projects that are needed for your project.
add_library ("${PROJECT_NAME}_lib" STATIC fastq_conversion.cpp)
target_include_directories ("${PROJECT_NAME}_lib" PUBLIC "${${PROJECT_NAME}_SOURCE_DIR}/include")
target_link_libraries ("${PROJECT_NAME}_lib" PUBLIC seqan3::seqan3 sharg::sharg seqan::hibf)
target_link_libraries ("${PROJECT_NAME}_lib" PUBLIC seqan3::seqan3 sharg::sharg seqan::hibf
fmindex-collection::fmindex-collection
)
target_compile_options ("${PROJECT_NAME}_lib" PUBLIC "-pedantic" "-Wall" "-Wextra")

# Add the application.
Expand Down

0 comments on commit b8cfb0f

Please sign in to comment.