Skip to content

Commit

Permalink
[INFRA] CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Jun 7, 2024
1 parent 6982ec6 commit bde67b7
Show file tree
Hide file tree
Showing 25 changed files with 278 additions and 428 deletions.
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ coverage:
default:
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
9 changes: 0 additions & 9 deletions .github/workflows/ci_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: raptor
fetch-depth: 0
submodules: true

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
93 changes: 33 additions & 60 deletions .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
# SPDX-FileCopyrightText: 2006-2023, Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2023, Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0

name: Coverage
Expand All @@ -23,96 +23,69 @@ env:

defaults:
run:
shell: bash -Eeuxo pipefail {0}
shell: bash -Eexuo pipefail {0}

jobs:
build:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
timeout-minutes: 120
runs-on: ubuntu-latest
name: ${{ matrix.compiler }}
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
strategy:
fail-fast: false
matrix:
include:
- name: "gcc13"
compiler: "gcc-13"
build: coverage
build_type: Coverage
cxx_flags: "-std=c++23"

compiler: ["gcc-14"]
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
volumes:
- /home/runner:/home/runner
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:
path: raptor
fetch-depth: ${{ steps.fetch_depth.outputs.depth }}
submodules: true

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

- name: Install CMake
uses: seqan/actions/setup-cmake@main
- name: Load ccache
uses: actions/cache@v4
with:
cmake: 3.25.3

- name: Install gcovr
env:
CC: ${{ matrix.compiler }}
run: |
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100
pip install gcovr==6.0
path: /home/runner/.ccache
save-always: true
key: ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }}

- name: Configure tests
run: |
mkdir build
cd build
cmake ../raptor/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }} -Wno-interference-size" \
-DHIBF_NATIVE_BUILD=OFF
make -j2 gtest_main
mkdir build && cd build
cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage \
-DCMAKE_CXX_FLAGS="-std=c++23 -Wno-interference-size"
make -j gtest_main
- name: Build tests
working-directory: build
run: |
ccache -z
cd build
make -k -j2
make -k -j
ccache -sv
- name: Run tests
run: |
cd build
ctest . -j2 --output-on-failure
working-directory: build
run: ctest . -j --output-on-failure

- name: Generate coverage report
run: |
gcovr --gcov-executable ${{ github.workspace }}/raptor/.github/workflows/scripts/gcov.sh \
--root ${{ github.workspace }}/raptor/test/coverage \
${{ github.workspace }}/build \
--filter ${{ github.workspace }}/raptor/include \
--filter ${{ github.workspace }}/raptor/src \
gcovr --root ${GITHUB_WORKSPACE}/test/coverage \
${GITHUB_WORKSPACE}/build \
--filter ${GITHUB_WORKSPACE}/raptor/include \
--filter ${GITHUB_WORKSPACE}/raptor/src \
--exclude-lines-by-pattern '^\s*$' \
--exclude-lines-by-pattern '^\s*};$' \
--exclude-lines-by-pattern '^.*GCOVR_EXCL_LINE.*$' \
--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 report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3.1.5
with:
files: ${{ github.workspace }}/build/coverage_report.xml
root_dir: ${{ github.workspace }}/raptor
files: build/coverage_report.xml
fail_ci_if_error: false
33 changes: 10 additions & 23 deletions .github/workflows/ci_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
# 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: Documentation
Expand All @@ -14,35 +14,24 @@ on:
workflow_dispatch:

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

env:
SHARG_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

defaults:
run:
shell: bash -Eeuxo pipefail {0}
shell: bash -Eexuo pipefail {0}

jobs:
build:
name: Documentation
runs-on: ubuntu-22.04
timeout-minutes: 120
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: raptor
fetch-depth: 2
submodules: true

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

- name: Install Doxygen
uses: seqan/actions/setup-doxygen@main
Expand All @@ -51,12 +40,10 @@ jobs:

- name: Configure tests
run: |
mkdir build
cd build
cmake ../raptor/test/documentation
make -j2 download-cppreference-doxygen-web-tag
mkdir build && cd build
cmake ../test/documentation
make -j download-cppreference-doxygen-web-tag
- name: Run tests
run: |
cd build
ctest . -j2 --output-on-failure
working-directory: build
run: ctest . -j --output-on-failure
51 changes: 17 additions & 34 deletions .github/workflows/ci_fortify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

concurrency:
group: fortify-${{ github.ref }}
group: fortify-actions
cancel-in-progress: true

env:
Expand All @@ -23,55 +23,38 @@ defaults:

jobs:
build:
name: ${{ matrix.name }} ${{ matrix.build_type }}
runs-on: ubuntu-22.04
timeout-minutes: 240
name: Fortify ${{ matrix.build_type }}
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
include:
- name: "Fortify"
build_type: Release
- build_type: Release
cxx_flags: "-fcf-protection=check"

- name: "Fortify"
build_type: Debug
- build_type: Debug
cxx_flags: "-fcf-protection=full"

container:
image: ghcr.io/seqan/gcc-14
volumes:
- /home/runner:/home/runner
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: raptor
fetch-depth: 1
submodules: true

- name: Setup compiler
uses: seqan/actions/setup-compiler@main
with:
compiler: gcc-13

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

- name: Configure tests
run: |
mkdir build
cd build
cmake ../raptor/test/unit -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="-std=c++23 -fexceptions -g -grecord-gcc-switches -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -mtune=native -fasynchronous-unwind-tables -fstack-clash-protection -Wno-interference-size ${{ matrix.cxx_flags }}"
make -j2 gtest_main
mkdir build && cd build
cmake ../test/unit -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="-std=c++23 -fexceptions -g -grecord-gcc-switches -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -mtune=native -fasynchronous-unwind-tables -fstack-clash-protection -Wno-interference-size ${{ matrix.cxx_flags }}"
make -j gtest_main
- name: Build tests
run: |
cd build
make -k -j2
working-directory: build
run: make -k -j

- name: Run tests
run: |
cd build
ctest . -j2 --output-on-failure
working-directory: build
run: ctest . -j --output-on-failure

3 changes: 1 addition & 2 deletions .github/workflows/ci_license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ env:
jobs:
check:
name: REUSE Compliance
runs-on: ubuntu-22.04
timeout-minutes: 120
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
steps:
- name: Checkout
Expand Down
Loading

0 comments on commit bde67b7

Please sign in to comment.