Skip to content

Commit

Permalink
[INFRA] Use containers for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiler committed Jun 5, 2024
1 parent b94acd4 commit d39bffa
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 207 deletions.
4 changes: 4 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,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
85 changes: 32 additions & 53 deletions .github/workflows/ci_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,90 +26,69 @@ defaults:

jobs:
build:
name: ${{ matrix.name }}
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
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: 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@v4
with:
fetch-depth: ${{ steps.fetch_depth.outputs.depth }}
submodules: false

- 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.18.6

- 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 ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DHIBF_VERBOSE_TESTS=OFF
make -j2 gtest_main
cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage
make -j gtest_main
- name: Build tests
env:
CCACHE_IGNOREOPTIONS: "-fprofile-abs-path"
working-directory: build
run: |
ccache -z
cd build
make -k -j2
make -k -j
ccache -sv
- name: Run tests
working-directory: build
run: |
cd build
ctest . -j2 --output-on-failure
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 }}/test/include \
--filter ${{ github.workspace }}/src \
--exclude ${{ github.workspace }}/include/hibf/contrib \
--exclude ${{ github.workspace }}/test/include/hibf/test/iterator_test_template.hpp \
gcovr --root ${GITHUB_WORKSPACE}/test/coverage \
${GITHUB_WORKSPACE}/build \
--filter ${GITHUB_WORKSPACE}/include \
--filter ${GITHUB_WORKSPACE}/test/include \
--filter ${GITHUB_WORKSPACE}/src \
--exclude ${GITHUB_WORKSPACE}/include/hibf/contrib \
--exclude ${GITHUB_WORKSPACE}/test/include/hibf/test/iterator_test_template.hpp \
--exclude-lines-by-pattern '^\s*$' \
--exclude-lines-by-pattern '^\s*};$' \
--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/[email protected]
with:
files: ${{ github.workspace }}/build/coverage_report.xml
files: build/coverage_report.xml
fail_ci_if_error: false
13 changes: 2 additions & 11 deletions .github/workflows/ci_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false

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

- name: Install Doxygen
uses: seqan/actions/setup-doxygen@main
Expand All @@ -55,6 +47,5 @@ jobs:
make -j2 download-cppreference-doxygen-web-tag
- name: Run tests
run: |
cd build
ctest . -j2 --output-on-failure
working-directory: build
run: ctest . -j2 --output-on-failure
3 changes: 1 addition & 2 deletions .github/workflows/ci_iwyu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ jobs:
mkdir build
cd build
cmake ../hibf/test/iwyu -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DHIBF_VERBOSE_TESTS=OFF
-DCMAKE_CXX_FLAGS="-stdlib=libc++"
- name: Run Test
run: |
Expand Down
75 changes: 20 additions & 55 deletions .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,77 +26,42 @@ 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: "clang17"
compiler: "clang-17"
build: unit
build_type: Release
cxx_flags: "-stdlib=libc++"

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

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

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

- name: "IntelLLVM"
compiler: "intel"
build: unit
build_type: Release

compiler: ["clang-18", "clang-17", "gcc-14", "gcc-13", "gcc-12", "gcc-11", "intel"]
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
volumes:
- /home/runner:/home/runner
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false

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

- name: Install CMake
if: contains(matrix.compiler, 'intel') == false
uses: seqan/actions/setup-cmake@main
- name: Load ccache
uses: actions/cache@v4
with:
cmake: 3.18.6
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 ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DHIBF_VERBOSE_TESTS=OFF \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
make -j2 gtest_main
mkdir build && cd build
cmake ../test/unit -DCMAKE_BUILD_TYPE=Release
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

15 changes: 9 additions & 6 deletions .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
fail-fast: true
matrix:
include:
- name: "clang18"
compiler: "clang-18"
build: unit
build_type: Release

- name: "clang17"
compiler: "clang-17"
build: unit
Expand Down Expand Up @@ -76,18 +81,16 @@ jobs:
run: |
mkdir build
cd build
cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DHIBF_VERBOSE_TESTS=OFF
cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
make -j3 gtest_main
- name: Build tests
working-directory: build
run: |
ccache -z
cd build
make -k -j3
ccache -sv
- name: Run tests
run: |
cd build
ctest . -j3 --output-on-failure
working-directory: build
run: ctest . -j3 --output-on-failure
38 changes: 16 additions & 22 deletions .github/workflows/ci_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ defaults:
jobs:
build:
name: ${{ matrix.name }}
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'
strategy:
Expand Down Expand Up @@ -90,32 +90,27 @@ jobs:
build: tutorial
build_type: Debug
use_include_dependencies: "OFF"
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
volumes:
- /home/runner:/home/runner

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false

- 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
- name: Load ccache
uses: actions/cache@v4
with:
cmake: ${{ contains(matrix.build, 'tutorial') && '3.21.7' || '3.18.6' }}
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
mkdir build && cd build
cmake ../test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
-DHIBF_VERBOSE_TESTS=OFF \
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}"
-DHIBF_USE_INCLUDE_DEPENDENCIES="${{ matrix.use_include_dependencies }}"
case "${{ matrix.build }}" in
unit) make -j2 gtest_main;;
Expand All @@ -126,21 +121,20 @@ jobs:
- name: Check cyclic includes
if: matrix.use_include_dependencies == 'ON'
working-directory: build
run: |
cd build
make -k -j2 all_dependencies
cmake .
- name: Build tests
if: matrix.use_include_dependencies == 'OFF'
working-directory: build
run: |
ccache -z
cd build
make -k -j2
ccache -sv
- name: Run tests
if: matrix.use_include_dependencies == 'OFF'
run: |
cd build
ctest . -j2 --output-on-failure
working-directory: build
run: ctest . -j2 --output-on-failure
Loading

0 comments on commit d39bffa

Please sign in to comment.