Skip to content

Commit 03d35af

Browse files
authored
Merge branch 'cppalliance:develop' into add-examples
2 parents a6c1c22 + ef56412 commit 03d35af

11 files changed

Lines changed: 574 additions & 263 deletions

File tree

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#
2+
# Copyright (c) 2026 Sam Darwin
3+
#
4+
# Distributed under the Boost Software License, Version 1.0. (See accompanying
5+
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
#
7+
# Official repository: https://github.com/cppalliance/capy/
8+
#
9+
10+
# Instructions
11+
#
12+
# After running this workflow successfully, go to https://github.com/ORGANIZATION/REPO/settings/pages
13+
# and enable github pages.
14+
# The coverage will be hosted at https://ORGANIZATION.github.io/REPO
15+
#
16+
17+
name: Code Coverage
18+
19+
on:
20+
push:
21+
branches:
22+
- master
23+
- develop
24+
25+
env:
26+
GIT_FETCH_JOBS: 8
27+
NET_RETRY_COUNT: 5
28+
29+
jobs:
30+
build:
31+
defaults:
32+
run:
33+
shell: bash
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
include:
39+
- runs-on: "ubuntu-24.04"
40+
name: Coverage
41+
42+
name: ${{ matrix.name }}
43+
runs-on: ${{ matrix.runs-on }}
44+
timeout-minutes: 120
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v6
49+
50+
- name: Get Branch
51+
run: |
52+
set -xe
53+
git config --global user.name cppalliance-bot
54+
git config --global user.email cppalliance-bot@example.com
55+
git fetch origin
56+
if git branch -r | grep origin/code-coverage; then
57+
echo "The code-coverage branch exists. Continuing."
58+
else
59+
echo "The code-coverage branch does not exist. Creating it."
60+
git checkout -b code-coverage
61+
git push origin code-coverage
62+
git checkout $GITHUB_REF_NAME
63+
fi
64+
65+
- name: Install Python
66+
uses: actions/setup-python@v6
67+
with:
68+
python-version: '3.13'
69+
70+
- name: Install Python packages
71+
run: pip install gcovr
72+
73+
- name: Checkout ci-automation
74+
uses: actions/checkout@v6
75+
with:
76+
repository: cppalliance/ci-automation
77+
path: ci-automation
78+
79+
- name: Run lcov/gcovr
80+
run: |
81+
set -xe
82+
ls -al
83+
export ORGANIZATION=${GITHUB_REPOSITORY_OWNER}
84+
export REPONAME=$(basename ${GITHUB_REPOSITORY})
85+
export B2_CXXSTD=20
86+
./ci-automation/scripts/lcov-jenkins-gcc-13.sh --only-gcovr
87+
88+
- name: Checkout target branch
89+
uses: actions/checkout@v6
90+
with:
91+
ref: code-coverage
92+
path: targetdir
93+
94+
- name: Copy gcovr results
95+
run: |
96+
set -xe
97+
pwd
98+
ls -al
99+
touch targetdir/.nojekyll
100+
mkdir -p targetdir/develop
101+
mkdir -p targetdir/master
102+
cp -rp gcovr targetdir/${GITHUB_REF_NAME}/
103+
echo -e "<html>\n<head>\n</head>\n<body>\n<a href=develop/index.html>develop</a><br>\n<a href=master/index.html>master</a><br>\n</body>\n</html>\n" > targetdir/index.html
104+
echo -e "<html>\n<head>\n</head>\n<body>\n<a href=gcovr/index.html>gcovr</a><br>\n</body>\n</html>\n" > targetdir/develop/index.html
105+
echo -e "<html>\n<head>\n</head>\n<body>\n<a href=gcovr/index.html>gcovr</a><br>\n</body>\n</html>\n" > targetdir/master/index.html
106+
cd targetdir
107+
git config --global user.name cppalliance-bot
108+
git config --global user.email cppalliance-bot@example.com
109+
git add .
110+
git commit --amend -m code-coverage
111+
git push -f origin code-coverage

0 commit comments

Comments
 (0)