Skip to content

Commit

Permalink
Merge pull request #249 from eseiler/infra/deps
Browse files Browse the repository at this point in the history
[INFRA] Update dependencies and CI
  • Loading branch information
eseiler authored Aug 15, 2024
2 parents f48073b + b481282 commit d2b2dd2
Show file tree
Hide file tree
Showing 13 changed files with 358 additions and 275 deletions.
4 changes: 4 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,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
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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

# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
41 changes: 41 additions & 0 deletions .github/workflows/ci_codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CodeQL

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

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

env:
SHARG_NO_VERSION_CHECK: 1
TZ: Europe/Berlin

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

jobs:
codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:cpp"
87 changes: 34 additions & 53 deletions .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,89 +19,70 @@ env:

defaults:
run:
shell: bash -Eexuo pipefail {0}
shell: bash -Eeuxo 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_type: Coverage

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@v3
with:
fetch-depth: ${{ steps.fetch_depth.outputs.depth }}

- name: Setup toolchain
uses: seqan/actions/setup-toolchain@main
uses: actions/checkout@v4
with:
compiler: ${{ matrix.compiler }}
ccache_size: 200M
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
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 .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Coverage \
-DCMAKE_CXX_FLAGS="-Werror -Wno-interference-size"
make -j2 gtest_main
make gtest_main
- name: Build tests
working-directory: build
run: |
ccache -z
cd build
make -k -j2 api_test cli_test display_layout measure_hyperloglog
ccache -sv
make -k api_test cli_test display_layout measure_hyperloglog
ccache -svvx
- 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 }}/.github/workflows/scripts/gcov.sh \
--root ${{ github.workspace }}/test/coverage \
${{ github.workspace }}/build \
--filter ${{ github.workspace }}/include \
--filter ${{ github.workspace }}/src \
--exclude ${{ github.workspace }}/src/util \
gcovr --root ${GITHUB_WORKSPACE}/test/coverage \
${GITHUB_WORKSPACE}/build \
--filter ${GITHUB_WORKSPACE}/include \
--filter ${GITHUB_WORKSPACE}/src \
--exclude ${GITHUB_WORKSPACE}/src/util \
--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 build
uses: codecov/codecov-action@v3
- name: Submit coverage report
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
69 changes: 45 additions & 24 deletions .github/workflows/ci_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ on:
push:
branches:
- 'main'
pull_request:
pull_request_target:
types:
- unlabeled
- closed
workflow_dispatch:

concurrency:
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 -Eexuo pipefail {0}
shell: bash -Eeuxo pipefail {0}

jobs:
build:
name: Documentation
runs-on: ubuntu-22.04
timeout-minutes: 120
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
runs-on: ubuntu-latest
if: ( github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' ) && github.event.action != 'closed'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
if: github.event_name != 'pull_request_target'
uses: actions/checkout@v4

- name: Install CMake
uses: seqan/actions/setup-cmake@main
# pull_request_target does not checkout the merge commit by default
- name: Checkout
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
with:
cmake: 3.25.3
ref: "refs/pull/${{ github.event.number }}/merge"

- name: Install Doxygen
uses: seqan/actions/setup-doxygen@main
Expand All @@ -45,24 +45,45 @@ jobs:

- name: Configure tests
run: |
mkdir build
cd build
mkdir build && cd build
cmake ..
- name: Run tests
working-directory: build
run: |
cd build
make -k -j2 doc 2>doxygen_warnings.txt
make -k doc 2>doxygen_warnings.txt
cat doxygen_warnings.txt
test ! -s doxygen_warnings.txt
- name: Package documentation
continue-on-error: true
run: tar -zcf documentation.tar.gz build
- name: Deploy Preview
if: github.event_name == 'pull_request_target'
uses: seqan/actions/documentation_deploy_preview@main
with:
deploy_host: ${{ secrets.DEPLOY_HOST }}
deploy_user: ${{ secrets.DEPLOY_USER }}
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
deploy_base_path: ${{ secrets.DEPLOY_PREVIEW_BASE_PATH }}
source_path_user_doc: build/doc/html
token: ${{ secrets.SEQAN_ACTIONS_PAT }}

- name: Upload documentation
continue-on-error: true
uses: actions/upload-artifact@v3
- name: Deploy Documentation
if: github.event_name == 'push'
uses: seqan/actions/documentation_deploy_production@main
with:
deploy_host: ${{ secrets.DEPLOY_HOST }}
deploy_user: ${{ secrets.DEPLOY_USER }}
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
source_path_user_doc: build/doc/html
deploy_path_user_doc: ${{ secrets.DEPLOY_PRODUCTION_BASE_PATH }}/main
delete:
name: Delete Preview
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' && github.event_name == 'pull_request_target' && github.event.action == 'closed'
steps:
- name: Delete Preview
uses: seqan/actions/documentation_delete_preview@main
with:
name: documentation
path: documentation.tar.gz
deploy_host: ${{ secrets.DEPLOY_HOST }}
deploy_user: ${{ secrets.DEPLOY_USER }}
deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }}
deploy_base_path: ${{ secrets.DEPLOY_PREVIEW_BASE_PATH }}
70 changes: 70 additions & 0 deletions .github/workflows/ci_header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Header

on:
push:
branches:
- 'main'
pull_request:
types:
- unlabeled
workflow_dispatch:

concurrency:
group: misc-${{ 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}

jobs:
build:
name: ${{ matrix.compiler }}
runs-on: ubuntu-latest
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
strategy:
fail-fast: false
matrix:
compiler: ["clang-18", "gcc-14", "gcc-12", "intel"]
include:
- cxx_flags: "-Wno-interference-size"
- compiler: "clang-18"
cxx_flags: ""
- 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: Load ccache
uses: actions/cache@v4
with:
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 .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-Werror ${{ matrix.cxx_flags }}" \
-DCHOPPER_HEADER_TEST_ONLY=ON
- name: Build tests
working-directory: build
run: |
ccache -z
make -k test
ccache -svvx
- name: Run tests
working-directory: build
run: ctest . -j --output-on-failure
Loading

0 comments on commit d2b2dd2

Please sign in to comment.