diff --git a/.github/config/codechecker.skip b/.github/config/codechecker.skip new file mode 100644 index 00000000..7ccb2a1a --- /dev/null +++ b/.github/config/codechecker.skip @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: CC0-1.0 + ++${GITHUB_WORKSPACE}/* +-* diff --git a/.github/config/codechecker.yml b/.github/config/codechecker.yml new file mode 100644 index 00000000..dec75185 --- /dev/null +++ b/.github/config/codechecker.yml @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: CC0-1.0 + +analyze: + - --enable=performance + - --enable=bugprone + - --enable=clang-diagnostic-shadow + - --disable=bugprone-easily-swappable-parameters + - --disable=clang-diagnostic-implicit-int-float-conversion + - --disable=clang-diagnostic-float-conversion + - --disable=clang-diagnostic-implicit-int-conversion + - --disable=bugprone-exception-escape + - --disable=bugprone-narrowing-conversions + - --disable=deadcode.DeadStores + - --skip=${GITHUB_WORKSPACE}/.github/config/codechecker.skip + - --clean + +parse: + - --export=html + - --output=./html + - --skip=${GITHUB_WORKSPACE}/.github/config/codechecker.skip + - --trim-path-prefix=${GITHUB_WORKSPACE}/ diff --git a/.github/workflows/ci_license.yml b/.github/workflows/ci_license.yml index cd64340b..6dab5eb5 100644 --- a/.github/workflows/ci_license.yml +++ b/.github/workflows/ci_license.yml @@ -27,7 +27,7 @@ defaults: jobs: check: name: REUSE Compliance - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 120 if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint' steps: diff --git a/.github/workflows/cron_codechecker.yml b/.github/workflows/cron_codechecker.yml new file mode 100644 index 00000000..53ac936f --- /dev/null +++ b/.github/workflows/cron_codechecker.yml @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: CC0-1.0 + +name: CodeChecker + +on: + schedule: + - cron: "0 8 * * MON" + workflow_dispatch: + +concurrency: + group: codechecker-${{ github.ref }} + cancel-in-progress: true + +env: + SHARG_NO_VERSION_CHECK: 1 + TZ: Europe/Berlin + +defaults: + run: + shell: bash -Eexuo pipefail {0} + +jobs: + build: + name: CodeChecker + runs-on: ubuntu-latest + if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' + container: + image: ghcr.io/seqan/clang-19 + steps: + - name: Run CodeChecker + uses: seqan/actions/codechecker@main + with: + configure_path: ../test/analyse + deploy_host: ${{ secrets.DEPLOY_HOST }} + deploy_user: ${{ secrets.DEPLOY_USER }} + deploy_ssh_key: ${{ secrets.DEPLOY_SSH_KEY }} + deploy_path: ${{ secrets.DEPLOY_CODECHECKER_PATH }} diff --git a/.github/workflows/cron_codeql.yml b/.github/workflows/cron_codeql.yml new file mode 100644 index 00000000..deaf4570 --- /dev/null +++ b/.github/workflows/cron_codeql.yml @@ -0,0 +1,55 @@ +# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: CC0-1.0 + +name: CodeQL + +on: + schedule: + - cron: "0 21 * * MON" + 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 + if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' + permissions: + security-events: write + container: + image: ghcr.io/seqan/gcc-14 + volumes: + - /home/runner:/home/runner + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: cpp + build-mode: manual + trap-caching: false + + - name: Build tests + run: | + cmake test/analyse -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + make -k + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:cpp" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1ad29a70..22fc5f62 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,7 +35,7 @@ jobs: group: lint-${{ github.event.pull_request.number }} cancel-in-progress: true needs: cancel_running_workflows - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 15 steps: - name: Run lint diff --git a/.github/workflows/readme_snippet.yml b/.github/workflows/readme_snippet.yml index 40c19a1f..186a6233 100644 --- a/.github/workflows/readme_snippet.yml +++ b/.github/workflows/readme_snippet.yml @@ -8,6 +8,11 @@ on: push: branches: - 'main' + workflow_dispatch: + +concurrency: + group: readme-snippet-${{ github.ref }} + cancel-in-progress: true env: TZ: Europe/Berlin @@ -19,11 +24,9 @@ defaults: jobs: readme-snippet: name: Update README - concurrency: - group: readme-snippet-${{ github.ref }} - cancel-in-progress: false - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 15 + if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' steps: - name: Checkout Sharg uses: actions/checkout@v4 diff --git a/.github/workflows/update_cookbook.yml b/.github/workflows/update_cookbook.yml index 9a09ffef..ca70325a 100644 --- a/.github/workflows/update_cookbook.yml +++ b/.github/workflows/update_cookbook.yml @@ -2,12 +2,17 @@ # SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik # SPDX-License-Identifier: CC0-1.0 -name: Sharg lint +name: Sharg Cookbook on: push: branches: - 'main' + workflow_dispatch: + +concurrency: + group: update-cookbook-${{ github.ref }} + cancel-in-progress: true env: TZ: Europe/Berlin @@ -19,11 +24,9 @@ defaults: jobs: update-cookbook: name: Update Cookbook - concurrency: - group: update-cookbook-${{ github.ref }} - cancel-in-progress: true - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 15 + if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' steps: - name: Checkout Sharg uses: actions/checkout@v4 diff --git a/test/analyse/CMakeLists.txt b/test/analyse/CMakeLists.txt new file mode 100644 index 00000000..27378a86 --- /dev/null +++ b/test/analyse/CMakeLists.txt @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin +# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required (VERSION 3.20...3.31) +project (sharg_test_analyze CXX) + +include (../sharg-test.cmake) + +enable_testing () + +add_subdirectory (../snippet snippet) +add_subdirectory (../unit unit) diff --git a/test/sharg-test.cmake b/test/sharg-test.cmake index ed14dc01..acc7382a 100644 --- a/test/sharg-test.cmake +++ b/test/sharg-test.cmake @@ -20,14 +20,21 @@ if (NOT DEFINED CMAKE_CXX_EXTENSIONS) set (CMAKE_CXX_EXTENSIONS OFF) endif () +set (SHARG_TEST_CPM_DIR + "${CMAKE_CURRENT_LIST_DIR}/../cmake/" + CACHE STRING "Path to directory containing CPM.cmake.") + +set (CPM_INDENT "CMake Package Manager CPM: ") +include ("${SHARG_TEST_CPM_DIR}/CPM.cmake") +CPMUsePackageLock ("${SHARG_TEST_CPM_DIR}/package-lock.cmake") + +include (${CMAKE_CURRENT_LIST_DIR}/cmake/sharg_require_ccache.cmake) + # require Sharg package find_package (Sharg REQUIRED HINTS ${CMAKE_CURRENT_LIST_DIR}/../cmake) enable_testing () -set (CPM_INDENT "CMake Package Manager CPM: ") -CPMUsePackageLock ("${CMAKE_CURRENT_LIST_DIR}/../cmake/package-lock.cmake") - include (CheckCXXSourceCompiles) include (FindPackageHandleStandardArgs) include (FindPackageMessage) @@ -115,5 +122,4 @@ list (APPEND SHARG_EXTERNAL_PROJECT_CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE=${CMAKE include (sharg_test_component) include (sharg_test_files) -include (sharg_require_ccache) include (add_subdirectories)