Skip to content

Commit ef588dd

Browse files
authored
Merge pull request #257 from eseiler/infra/ci
[INFRA] Update CI
2 parents 215da66 + c874687 commit ef588dd

19 files changed

+262
-667
lines changed

.codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ coverage:
2020
if_ci_failed: success # per default, codecov would fail if any CI fails
2121
informational: true # the codecov/patch status is never "fail"
2222
only_pulls: true # only post codecov/patch status on PRs
23+
24+
parsers:
25+
cobertura:
26+
partials_as_hits: true

.github/workflows/api.yml

Lines changed: 46 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
33
# SPDX-License-Identifier: CC0-1.0
44

5-
name: Sharg API-Stability
5+
name: API-Stability
66

77
on:
88
# Will always run on the default branch
@@ -16,96 +16,82 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
env:
19-
CMAKE_VERSION: 3.16.9
2019
SHARG_NO_VERSION_CHECK: 1
2120
TZ: Europe/Berlin
2221
ISSUE: 146 # Issue number to use for reporting failures
2322

2423
defaults:
2524
run:
26-
shell: bash -exo pipefail {0}
25+
shell: bash -Eeuxo pipefail {0}
2726

2827
jobs:
2928
build:
30-
name: API-Stability gcc${{ matrix.compiler }}
31-
runs-on: ubuntu-22.04
32-
timeout-minutes: 300
29+
name: API-Stability ${{ matrix.compiler }}
30+
runs-on: ubuntu-latest
3331
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch'
3432
strategy:
3533
fail-fast: false
3634
matrix:
37-
compiler: [11, 12, 13]
38-
35+
compiler: ["gcc-14", "gcc-13", "gcc-12"]
36+
container:
37+
image: ghcr.io/seqan/${{ matrix.compiler }}
38+
volumes:
39+
- /home/runner:/home/runner
3940
steps:
40-
- name: Checkout Sharg
41+
- name: Checkout
4142
uses: actions/checkout@v4
4243
with:
43-
path: sharg
44-
fetch-depth: 1
4544
submodules: true
4645

47-
- name: Setup toolchain
48-
uses: seqan/actions/setup-toolchain@main
49-
with:
50-
compiler: gcc-${{ matrix.compiler }}
51-
ccache_size: 75M
52-
53-
- name: Install CMake
54-
uses: seqan/actions/setup-cmake@main
55-
with:
56-
cmake: 3.16.9
57-
5846
- name: Configure tests
5947
run: |
60-
mkdir sharg-build
61-
cd sharg-build
62-
cmake ../sharg/test/api_stability -DCMAKE_BUILD_TYPE=Release
48+
mkdir build && cd build
49+
cmake ../test/api_stability -DCMAKE_BUILD_TYPE=Release
6350
6451
- name: Build tests
65-
run: |
66-
cd sharg-build
67-
CMAKE_BUILD_PARALLEL_LEVEL=2 cmake --build . -- -k 2>&1 | tee build.log
68-
69-
- name: Setup Python
70-
if: ${{ failure() }}
71-
uses: actions/setup-python@v5
72-
with:
73-
python-version: '3.x'
74-
75-
- name: Process Log
76-
if: ${{ failure() }}
77-
run: |
78-
FILE="seqan3/.github/ISSUE_TEMPLATE/cron_comment_template.md"
79-
python3 seqan3/.github/workflows/scripts/process_compiler_error_log.py sharg-build/build.log >> $FILE
52+
working-directory: build
53+
run: make -k 2>&1 | tee build.log
8054

8155
- name: Create comment body
82-
if: ${{ failure() }}
56+
if: always()
8357
id: comment-body
8458
run: |
85-
FILE="sharg/.github/ISSUE_TEMPLATE/cron_comment_template.md"
86-
URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
87-
sed -i "s@{{ build }}@${{ matrix.build }}@" $FILE
88-
sed -i "s@{{ compiler }}@${{ matrix.compiler }}@" $FILE
89-
sed -i "s@{{ url }}@$URL@" $FILE
90-
echo "body<<EOF" >> $GITHUB_OUTPUT
91-
cat $FILE >> $GITHUB_OUTPUT
92-
echo "EOF" >> $GITHUB_OUTPUT
59+
if [[ "${{ job.status }}" == "success" ]]; then
60+
echo "body=Success ${{ matrix.build }} on ${{ matrix.compiler }}" >> $GITHUB_OUTPUT
61+
else
62+
FILE=".github/ISSUE_TEMPLATE/cron_comment_template.md"
63+
python3 .github/workflows/scripts/process_compiler_error_log.py build/build.log >> ${FILE}
64+
URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
65+
sed -i "s@{{ build }}@${{ matrix.build }}@" ${FILE}
66+
sed -i "s@{{ compiler }}@${{ matrix.compiler }}@" ${FILE}
67+
sed -i "s@{{ url }}@$URL@" ${FILE}
68+
echo "body<<EOF" >> $GITHUB_OUTPUT
69+
cat ${FILE} >> $GITHUB_OUTPUT
70+
echo "EOF" >> $GITHUB_OUTPUT
71+
fi
9372
9473
- name: Reopen issue
95-
if: ${{ failure() }}
96-
uses: octokit/[email protected]
97-
with:
98-
route: PATCH /repos/{owner}/{repo}/issues/{issue_number}
99-
owner: ${{ github.repository_owner }}
100-
repo: sharg-parser
101-
issue_number: ${{ env.ISSUE }}
102-
state: "open"
74+
if: failure()
75+
run: gh issue reopen ${{ env.ISSUE }}
10376
env:
104-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
GH_TOKEN: ${{ secrets.SEQAN_ACTIONS_PAT }}
78+
GH_REPO: ${{ github.repository }}
10579

106-
- name: Create comment
107-
if: ${{ failure() }}
80+
- name: Find Comment
81+
if: always()
82+
uses: peter-evans/find-comment@v3
83+
id: find_comment
84+
with:
85+
issue-number: ${{ env.ISSUE }}
86+
body-includes: ${{ matrix.build }} on ${{ matrix.compiler }}
87+
88+
- name: Update comment
89+
if: always()
10890
uses: peter-evans/create-or-update-comment@v4
10991
with:
92+
comment-id: ${{ steps.find_comment.outputs.comment-id }}
11093
issue-number: ${{ env.ISSUE }}
11194
body: ${{ steps.comment-body.outputs.body }}
95+
edit-mode: replace
96+
token: ${{ secrets.SEQAN_ACTIONS_PAT }}
97+

.github/workflows/ci_cmake.yml

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,59 +28,42 @@ defaults:
2828
jobs:
2929
build:
3030
name: "External project ${{ contains(matrix.SHARG_NO_TDL, 'OFF') && 'with TDL' || 'without TDL' }}"
31-
runs-on: ubuntu-22.04
32-
timeout-minutes: 120
31+
runs-on: ubuntu-latest
3332
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
3433
strategy:
3534
fail-fast: false
3635
matrix:
3736
SHARG_NO_TDL: [ON, OFF]
38-
37+
container:
38+
image: ghcr.io/seqan/gcc-14
39+
volumes:
40+
- /home/runner:/home/runner
3941
steps:
4042
- name: Checkout
4143
uses: actions/checkout@v4
4244
with:
43-
path: sharg-parser
44-
fetch-depth: 1
4545
submodules: true
4646

47-
- name: Install CMake
48-
uses: seqan/actions/setup-cmake@main
49-
with:
50-
cmake: 3.16.9
51-
52-
- name: Setup toolchain
53-
uses: seqan/actions/setup-toolchain@main
54-
with:
55-
compiler: gcc-13
56-
5747
- name: Install dependencies
5848
if: matrix.SHARG_NO_TDL == 'OFF'
5949
run: |
6050
git clone --depth 1 --single-branch --branch 0.8.0 https://github.com/jbeder/yaml-cpp.git
61-
cd yaml-cpp
62-
mkdir build
63-
cd build
51+
cd yaml-cpp && mkdir build && cd build
6452
cmake ../ -DCMAKE_BUILD_TYPE=Debug \
6553
-DYAML_CPP_BUILD_CONTRIB=OFF \
6654
-DYAML_CPP_BUILD_TOOLS=OFF \
6755
-DYAML_BUILD_SHARED_LIBS=OFF \
6856
-DYAML_CPP_INSTALL=ON \
69-
-DYAML_CPP_BUILD_TESTS=OFF \
70-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
71-
make -j2
72-
sudo make install
57+
-DYAML_CPP_BUILD_TESTS=OFF
58+
make install
7359
7460
- name: Configure tests
7561
run: |
76-
mkdir sharg-build
77-
cd sharg-build
78-
cmake ../sharg-parser/test/external_project -DCMAKE_BUILD_TYPE=Debug \
79-
-DSHARG_NO_TDL=${{ matrix.SHARG_NO_TDL }}
80-
make -j2 sharg_test_prerequisite
62+
mkdir build && cd build
63+
cmake ../test/external_project -DCMAKE_BUILD_TYPE=Debug \
64+
-DSHARG_NO_TDL=${{ matrix.SHARG_NO_TDL }}
65+
make -k sharg_test_prerequisite
8166
8267
- name: Build tests
83-
run: |
84-
cd sharg-build
85-
make -k -j2
86-
68+
working-directory: build
69+
run: make -k

.github/workflows/ci_coverage.yml

Lines changed: 49 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,15 @@ name: Coverage
77
on:
88
push:
99
branches:
10-
# Push events to branches matching refs/heads/main
1110
- 'main'
12-
# Push events to branches matching refs/heads/release*
13-
- 'release*'
14-
# Trigger after PR was unlabeled
1511
pull_request:
1612
types:
1713
- unlabeled
18-
# Enables a manual trigger, may run on any branch
1914
workflow_dispatch:
2015

21-
# Do not cancel on push events
2216
concurrency:
2317
group: coverage-${{ github.event.pull_request.number || github.ref }}
24-
cancel-in-progress: false # PRs will be canceled by the clang-format CI
18+
cancel-in-progress: false
2519

2620
env:
2721
SHARG_NO_VERSION_CHECK: 1
@@ -33,70 +27,72 @@ defaults:
3327

3428
jobs:
3529
build:
36-
name: ${{ matrix.name }}
37-
runs-on: ubuntu-22.04
38-
timeout-minutes: 120
30+
runs-on: ubuntu-latest
31+
name: ${{ matrix.compiler }}
3932
if: github.repository_owner == 'seqan' || github.event_name == 'workflow_dispatch' || github.event.label.name == 'lint'
4033
strategy:
41-
fail-fast: true
34+
fail-fast: false
4235
matrix:
43-
include:
44-
- name: "gcc13"
45-
compiler: "gcc-13"
46-
build: coverage
47-
build_type: Coverage
48-
36+
compiler: ["gcc-14"]
37+
container:
38+
image: ghcr.io/seqan/${{ matrix.compiler }}
39+
volumes:
40+
- /home/runner:/home/runner
4941
steps:
50-
# How many commits do we need to fetch to also fetch the branch point?
51-
- name: Get fetch depth
52-
id: fetch_depth
53-
run: echo "depth=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> $GITHUB_OUTPUT
54-
5542
- name: Checkout
5643
uses: actions/checkout@v4
5744
with:
58-
path: sharg
59-
fetch-depth: ${{ steps.fetch_depth.outputs.depth }}
45+
fetch-depth: 0
6046
submodules: true
6147

62-
- name: Setup toolchain
63-
uses: seqan/actions/setup-toolchain@main
64-
with:
65-
compiler: ${{ matrix.compiler }}
66-
ccache_size: 125M
67-
68-
- name: Install CMake
69-
uses: seqan/actions/setup-cmake@main
48+
- name: Load ccache
49+
uses: actions/cache@v4
7050
with:
71-
cmake: 3.16.9
51+
path: /home/runner/.ccache
52+
key: ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }}-${{ github.run_id }}
53+
restore-keys: |
54+
ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}-${{ github.ref }}
55+
ccache-${{ runner.os }}-${{ github.workflow }}-${{ matrix.compiler }}
7256
73-
- name: Install gcovr
74-
run: |
75-
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/${CC/gcc/gcov} 100
76-
pip install gcovr==6.0
57+
- name: Increase ccache size
58+
run: echo "CCACHE_MAXSIZE=300M" >> "${GITHUB_ENV}"
7759

7860
- name: Configure tests
7961
run: |
80-
mkdir sharg-build
81-
cd sharg-build
82-
cmake ../sharg/test/${{ matrix.build }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
83-
-DCMAKE_CXX_FLAGS="${{ matrix.cxx_flags }}" \
84-
-DSHARG_VERBOSE_TESTS=OFF \
85-
-DSHARG_COVERAGE_PARALLEL_LEVEL=2
86-
make -j2 gtest_build yaml-cpp
62+
mkdir build && cd build
63+
cmake ../test/coverage -DCMAKE_BUILD_TYPE=Coverage
64+
make gtest_build yaml-cpp
8765
8866
- name: Build tests
89-
env:
90-
CCACHE_IGNOREOPTIONS: "-fprofile-abs-path"
91-
GCOV: ${{ github.workspace }}/sharg/.github/workflows/scripts/gcov.sh
67+
working-directory: build
9268
run: |
9369
ccache -z
94-
cd sharg-build
95-
make -k -j2
96-
ccache -sv
70+
make -k
71+
ccache -svvx
72+
73+
- name: Run tests
74+
working-directory: build
75+
run: ctest . -j --output-on-failure --no-tests=error
76+
77+
- name: Generate coverage report
78+
run: |
79+
gcovr --root ${GITHUB_WORKSPACE}/test/coverage \
80+
${GITHUB_WORKSPACE}/build \
81+
--filter ${GITHUB_WORKSPACE}/include/sharg \
82+
--filter ${GITHUB_WORKSPACE}/test/include/sharg/test \
83+
--exclude ${GITHUB_WORKSPACE}/include/sharg/contrib \
84+
--exclude ${GITHUB_WORKSPACE}/include/sharg/std \
85+
--exclude-lines-by-pattern '^\s*$' \
86+
--exclude-lines-by-pattern '^\s*};$' \
87+
--exclude-unreachable-branches \
88+
--exclude-throw-branches \
89+
--exclude-noncode-lines \
90+
-j \
91+
--cobertura \
92+
--output ${GITHUB_WORKSPACE}/build/coverage_report.xml
9793
9894
- name: Submit coverage build
99-
uses: codecov/codecov-action@v3
95+
uses: codecov/codecov-action@v3.1.5
10096
with:
101-
files: ${{ github.workspace }}/sharg-build/sharg_coverage.xml
102-
root_dir: ${{ github.workspace }}/sharg
97+
files: build/coverage_report.xml
98+
fail_ci_if_error: false

.github/workflows/ci_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
cancel-in-progress: ${{ github.event_name != 'push' }}
2020

2121
env:
22-
SEQAN3_NO_VERSION_CHECK: 1
22+
SHARG_NO_VERSION_CHECK: 1
2323
TZ: Europe/Berlin
2424

2525
defaults:

0 commit comments

Comments
 (0)