Skip to content

Commit

Permalink
Merge pull request #84 from eseiler/infra/ci
Browse files Browse the repository at this point in the history
[INFRA] Update CI
  • Loading branch information
eseiler authored Nov 18, 2024
2 parents 032fd9b + a4ca058 commit 7060edb
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 130 deletions.
4 changes: 4 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ coverage:
if_ci_failed: success # per default, codecov would fail if any CI fails
informational: true # the codecov/patch status is never "fail"
only_pulls: true # only post codecov/patch status on PRs

parsers:
cobertura:
partials_as_hits: true
61 changes: 20 additions & 41 deletions .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,69 +22,48 @@ defaults:

jobs:
build:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
timeout-minutes: 120
runs-on: ubuntu-latest
name: ${{ matrix.compiler }}
strategy:
fail-fast: false
matrix:
include:
- name: "gcc13"
compiler: "gcc-13"

compiler: ["gcc-14"]
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
volumes:
- /home/runner:/home/runner
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
with:
compiler: ${{ matrix.compiler }}
ccache_size: 125M

- name: Install CMake
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.25.3

- name: Install gcovr
run: |
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100
pip install gcovr==6.0
- name: Configure
- name: Configure tests
run: |
mkdir build
cd build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="--coverage -fprofile-arcs -ftest-coverage -Werror" \
-DCMAKE_C_FLAGS="--coverage -fprofile-arcs -ftest-coverage -Werror" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-lgcov" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-lgcov"
- name: Build and run tests
run: |
cd build
make -j2 -k check
working-directory: build
run: make -k check

- name: Generate coverage report
run: |
gcovr --gcov-executable ${{ github.workspace }}/.github/workflows/scripts/gcov.sh \
--root ${{ github.workspace }} \
${{ github.workspace }}/build \
--filter ${{ github.workspace }}/include \
--filter ${{ github.workspace }}/src \
gcovr --root ${GITHUB_WORKSPACE} \
${GITHUB_WORKSPACE}/build \
--filter ${GITHUB_WORKSPACE}/include \
--filter ${GITHUB_WORKSPACE}/src \
--exclude-unreachable-branches \
--exclude-throw-branches \
--exclude-noncode-lines \
-j 2 \
--xml \
--output ${{ github.workspace }}/build/coverage_report.xml
-j \
--cobertura \
--output ${GITHUB_WORKSPACE}/build/coverage_report.xml
- name: Submit coverage build
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3.1.5
with:
files: ${{ github.workspace }}/build/coverage_report.xml
files: build/coverage_report.xml
fail_ci_if_error: false
33 changes: 33 additions & 0 deletions .github/workflows/ci_cpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0

name: Update CPM

on:
schedule:
- cron: "0 12 * * SAT"
workflow_dispatch:

env:
TZ: Europe/Berlin

concurrency:
group: update-cpm-actions
cancel-in-progress: true

jobs:
update_cpm:
name: Update CPM
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.repository_owner == 'seqan'
steps:
- name: Run update CPM
uses: seqan/actions/update_cpm_package_lock@main
with:
token: ${{ secrets.SEQAN_ACTIONS_PAT }}
gpg_key: ${{ secrets.SEQAN_ACTIONS_GPG_KEY }}
gpg_passphrase: ${{ secrets.SEQAN_ACTIONS_GPG_PASSPHRASE }}
package_lock_file: cmake/package-lock.cmake

2 changes: 1 addition & 1 deletion .github/workflows/ci_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
jobs:
check:
name: REUSE Compliance
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
Expand Down
52 changes: 14 additions & 38 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,53 +22,29 @@ defaults:

jobs:
build:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
timeout-minutes: 120
runs-on: ubuntu-latest
name: ${{ matrix.compiler }}
strategy:
fail-fast: false
matrix:
compiler: ["clang-19", "clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "intel"]
include:
- name: "clang17"
compiler: "clang-17"
build_type: Release
cxx_flags: "-stdlib=libc++"

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

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

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

- compiler: "intel"
cxx_flags: "-fp-model=strict -Wno-overriding-option"
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
volumes:
- /home/runner:/home/runner
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
with:
compiler: ${{ matrix.compiler }}
ccache_size: 75M

- name: Install CMake
uses: seqan/actions/setup-cmake@main
with:
cmake: 3.25.3

- name: Configure
- name: Configure tests
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Werror"
- name: Build and run tests
run: |
cd build
make -j2 -k check
working-directory: build
run: make -k check
39 changes: 14 additions & 25 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,32 @@ defaults:

jobs:
build:
name: ${{ matrix.name }}
runs-on: macos-12
timeout-minutes: 120
name: ${{ matrix.compiler }}
runs-on: macos-14
strategy:
fail-fast: false
matrix:
include:
- name: "clang17"
compiler: "clang-17"
build_type: Release

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

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

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

compiler: ["clang-19", "clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12"]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
- name: Setup compiler
uses: seqan/actions/setup-compiler@main
with:
compiler: ${{ matrix.compiler }}

- name: Patch M1 GCC
if: contains(matrix.compiler, 'gcc') && matrix.compiler != 'gcc-14'
uses: seqan/actions/patch-m1-gcc@main
with:
compiler: ${{ matrix.compiler }}
ccache_size: 75M

- name: Configure
- name: Configure tests
run: |
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Werror"
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-Werror"
- name: Build and run tests
working-directory: build
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/scripts/gcov.sh

This file was deleted.

7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ project (app-template
DESCRIPTION "My application description"
)

# LTO support.
include (CheckIPOSupported)
check_ipo_supported (RESULT result OUTPUT output)
if (result)
set (CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
endif ()

# This allows including `*.cmake` files from the `cmake` directory without specifying the full path.
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

Expand Down
4 changes: 2 additions & 2 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set (CPM_DOWNLOAD_VERSION 0.38.7)
set (CPM_HASH_SUM "83e5eb71b2bbb8b1f2ad38f1950287a057624e385c238f6087f94cdfc44af9c5")
set (CPM_DOWNLOAD_VERSION 0.40.2)
set (CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")

if (CPM_SOURCE_CACHE)
set (CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
Expand Down
23 changes: 12 additions & 11 deletions cmake/package-lock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,66 @@
# This file should be committed to version control

# hibf
set (HIBF_VERSION 894f663c7b77f28cc2b1b8f4252e51c052c49bb2)
set (HIBF_VERSION 1ce6960ce2400b53f3e64d2173b33d881d3358e0)
CPMDeclarePackage (hibf
NAME hibf
GIT_TAG ${HIBF_VERSION}
GIT_TAG ${HIBF_VERSION} # main
GITHUB_REPOSITORY seqan/hibf
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
OPTIONS "INSTALL_HIBF OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# sharg
set (SHARG_VERSION 01f848eeb6dbac3d50a718a8ee26bcf695edf5a8)
set (SHARG_VERSION c4367d1049322826e60c674b6bf24d3d0a8da999)
CPMDeclarePackage (sharg
NAME sharg
GIT_TAG ${SHARG_VERSION}
GIT_TAG ${SHARG_VERSION} # main
GITHUB_REPOSITORY seqan/sharg-parser
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
OPTIONS "INSTALL_SHARG OFF" "INSTALL_TDL OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# seqan3
set (SEQAN3_VERSION fee3fb8e5976b455e848dd68c57f64fd3f67c3c2)
set (SEQAN3_VERSION a79244729de1fb45b030cb7a4d8078f47f81d5f1)
CPMDeclarePackage (seqan3
NAME seqan3
GIT_TAG ${SEQAN3_VERSION}
GIT_TAG ${SEQAN3_VERSION} # main
GITHUB_REPOSITORY seqan/seqan3
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
OPTIONS "INSTALL_SEQAN3 OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

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

# googletest
set (GOOGLETEST_VERSION 1.14.0)
set (GOOGLETEST_VERSION 1.15.2)
CPMDeclarePackage (googletest
NAME GTest
VERSION ${GOOGLETEST_VERSION}
GITHUB_REPOSITORY google/googletest
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
OPTIONS "BUILD_GMOCK OFF" "INSTALL_GTEST OFF" "CMAKE_CXX_STANDARD 20"
"CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# use_ccache
set (USE_CCACHE_VERSION d2a54ef555b6fc2d496a4c9506dbeb7cf899ce37)
CPMDeclarePackage (use_ccache
NAME use_ccache
GIT_TAG ${USE_CCACHE_VERSION}
GIT_TAG ${USE_CCACHE_VERSION} # main
GITHUB_REPOSITORY seqan/cmake-scripts
SOURCE_SUBDIR ccache
SYSTEM TRUE
Expand Down

0 comments on commit 7060edb

Please sign in to comment.