Skip to content

Commit

Permalink
Merge pull request #3270 from eseiler/infra/ci
Browse files Browse the repository at this point in the history
[INFRA] CI and Compilers
  • Loading branch information
eseiler authored Jul 18, 2024
2 parents 69284e8 + 82e9727 commit 7c80e35
Show file tree
Hide file tree
Showing 23 changed files with 232 additions and 559 deletions.
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# See https://docs.codecov.io/docs/codecovyml-reference
codecov:
token: a75b1e95-134c-4ada-adac-5846045f188
require_ci_to_pass: no # codecov reports its results independent of whether CI passed
notify:
wait_for_ci: no # codecov has not to wait until the CI is finished to post its results
Expand All @@ -19,3 +20,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: 21 additions & 40 deletions .github/workflows/ci_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,74 +28,55 @@ defaults:
jobs:
build:
name: ${{ matrix.name }}
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'
strategy:
fail-fast: false
matrix:
include:
- name: "Non-cyclic tests"
compiler: "gcc-13"
compiler: "gcc-14"
build: unit
build_type: Debug
use_include_dependencies: "ON"
cmake_depends_use_compiler: "OFF"

- name: "External project"
compiler: "gcc-13"
compiler: "gcc-14"
build: external_project
build_type: Debug

use_include_dependencies: "OFF"
cmake_depends_use_compiler: "ON"
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
volumes:
- /home/runner:/home/runner
steps:
- name: Checkout SeqAn3
- name: Checkout
uses: actions/checkout@v4
with:
path: seqan3
fetch-depth: 1
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: seqan3/submodules/seqan
fetch-depth: 1

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

- name: Install CMake dependency
if: matrix.build == 'external_project'
run: |
mkdir -p /tmp/libidn11-download
wget --retry-connrefused --waitretry=30 --read-timeout=30 --timeout=30 --tries=20 --no-clobber --quiet --directory-prefix=/tmp/libidn11-download/ http://ftp.de.debian.org/debian/pool/main/libi/libidn/libidn11_1.33-3_amd64.deb
sudo dpkg -i /tmp/libidn11-download/libidn11_1.33-3_amd64.deb
- name: Setup compiler
uses: seqan/actions/setup-compiler@main
with:
compiler: ${{ matrix.compiler }}
path: submodules/seqan

- name: Configure tests
run: |
mkdir seqan3-build
cd seqan3-build
cmake ../seqan3/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSEQAN3_VERBOSE_TESTS=OFF \
-DSEQAN3_USE_INCLUDE_DEPENDENCIES="${{ matrix.use_include_dependencies }}"
mkdir build && cd build
cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_DEPENDS_USE_COMPILER="${{ matrix.cmake_depends_use_compiler }}" \
-DSEQAN3_USE_INCLUDE_DEPENDENCIES="${{ matrix.use_include_dependencies }}"
case "${{ matrix.build }}" in
unit) make -j${{ matrix.build_threads }} gtest_build;;
external_project) make -j${{ matrix.build_threads }} seqan3_test_prerequisite sharg_test_prerequisite;;
unit) make gtest_build;;
external_project) make seqan3_test_prerequisite sharg_test_prerequisite;;
esac
- name: Build tests
working-directory: build
run: |
cd seqan3-build
case "${{ matrix.build }}" in
unit) make -k -j2 all_dependencies; cmake .;;
external_project) make -k -j1;;
unit) make -k all_dependencies; cmake .;;
external_project) make -k;;
esac
101 changes: 51 additions & 50 deletions .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,78 +27,79 @@ defaults:

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: true
fail-fast: false
matrix:
include:
- name: "gcc13"
compiler: "gcc-13"
build: coverage
build_type: Debug

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 SeqAn3
- name: Checkout
uses: actions/checkout@v4
with:
path: seqan3
fetch-depth: ${{ steps.fetch_depth.outputs.depth }}
submodules: true
fetch-depth: 0

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: seqan3/submodules/seqan
fetch-depth: 1

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

- name: Install CMake
uses: seqan/actions/setup-cmake@main
- name: Load ccache
uses: actions/cache@v4
with:
cmake: 3.16.9
path: /home/runner/.ccache
save-always: true
key: ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }}
ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}
- name: Install gcovr
run: |
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100
pip install gcovr==6.0
- name: Increase ccache size
run: echo "CCACHE_MAXSIZE=300M" >> "${GITHUB_ENV}"

- name: Configure tests
run: |
mkdir seqan3-build
cd seqan3-build
cmake ../seqan3/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DSEQAN3_VERBOSE_TESTS=OFF \
-DSEQAN3_BENCHMARK_MIN_TIME=0.01 \
-DSEQAN3_COVERAGE_PARALLEL_LEVEL=2
make -j2 gtest_build
mkdir build && cd build
cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage
make gtest_build
- name: Build tests
env:
GCOV: ${{ github.workspace }}/seqan3/.github/workflows/scripts/gcov.sh
working-directory: build
run: |
ccache -z
cd seqan3-build
make -k -j2
ccache -sv
make -k
ccache -svvx
- name: Run tests
working-directory: build
run: ctest . -j --output-on-failure

- name: Generate coverage report
run: |
gcovr --root ${GITHUB_WORKSPACE}/test/coverage \
${GITHUB_WORKSPACE}/build \
--filter ${GITHUB_WORKSPACE}/include/seqan3 \
--filter ${GITHUB_WORKSPACE}/test/include/seqan3/test \
--exclude ${GITHUB_WORKSPACE}/include/seqan3/contrib \
--exclude ${GITHUB_WORKSPACE}/include/seqan3/std \
--exclude-lines-by-pattern '^\s*$' \
--exclude-lines-by-pattern '^\s*};$' \
--exclude-unreachable-branches \
--exclude-throw-branches \
--exclude-noncode-lines \
-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:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/seqan3-build/seqan3_coverage.xml
root_dir: ${{ github.workspace }}/seqan3
files: build/coverage_report.xml
fail_ci_if_error: false
35 changes: 8 additions & 27 deletions .github/workflows/ci_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,16 @@ env:

defaults:
run:
shell: bash -Eexuo pipefail {0}
shell: bash -Eeuxo 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 SeqAn3
- name: Checkout
uses: actions/checkout@v4
with:
path: seqan3
fetch-depth: 1
submodules: true

- name: Checkout SeqAn2
uses: actions/checkout@v4
with:
repository: seqan/seqan
path: seqan3/submodules/seqan
fetch-depth: 1

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

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

- name: Configure tests
run: |
mkdir seqan3-build
cd seqan3-build
cmake ../seqan3/test/documentation
make -j2 download-cppreference-doxygen-web-tag
mkdir build && cd build
cmake ../test/documentation
make download-cppreference-doxygen-web-tag
- name: Run tests
run: |
cd seqan3-build
ctest . -j2 --output-on-failure
working-directory: build
run: ctest . -j --output-on-failure
Loading

0 comments on commit 7c80e35

Please sign in to comment.