Skip to content

Commit 39cb9dc

Browse files
committed
move build stuff to build dir
1 parent 99b97db commit 39cb9dc

32 files changed

+345
-162
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tool-configs/clang-format/.clang-format

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tool-configs/clang-tidy/.clang-tidy

.github/workflows/ci.yml

Lines changed: 93 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,83 @@ env:
1010
MYCI_GIT_USERNAME: igagis
1111
MYCI_GIT_PASSWORD: ${{ secrets.MYCI_GIT_ACCESS_TOKEN }}
1212
jobs:
13+
##### coverage #####
14+
coverage:
15+
runs-on: ubuntu-latest
16+
container: debian:bookworm
17+
name: coverage - measure
18+
env:
19+
linux_distro: debian
20+
linux_release: bookworm
21+
steps:
22+
- name: add cppfw deb repo
23+
uses: myci-actions/add-deb-repo@main
24+
with:
25+
repo: deb https://gagis.hopto.org/repo/cppfw/${{ env.linux_distro }} ${{ env.linux_release }} main
26+
repo-name: cppfw
27+
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
28+
install: myci locales git pipx
29+
- name: add llvm repo (for clang-format)
30+
uses: myci-actions/add-deb-repo@main
31+
with:
32+
repo: deb http://apt.llvm.org/${{ env.linux_release }} llvm-toolchain-${{ env.linux_release }} main
33+
repo-name: llvm
34+
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
35+
- name: git clone
36+
uses: myci-actions/checkout@main
37+
- name: prepare debian package
38+
run: myci-deb-prepare.sh
39+
- name: install deps
40+
run: myci-deb-install-build-deps.sh
41+
- name: add DE locale
42+
# needed for testing that locale with "," as decimal delimiter does not break the parsing with string_parser
43+
run: |
44+
echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen
45+
locale-gen
46+
- name: build
47+
run: make config=gcov
48+
- name: test
49+
run: make config=gcov test
50+
- name: generate coverage report
51+
# due to some bug in gcov, we need to use --gcov-ignore-parse-errors=negative_hits.warn
52+
run: pipx run gcovr --gcov-ignore-parse-errors=negative_hits.warn --exclude-throw-branches --filter src/ --cobertura > cobertura.xml
53+
- name: upload coverage report to artifacts
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: cobertura.xml
57+
path: cobertura.xml
58+
- name: upload coverage data to codecov.io
59+
uses: codecov/codecov-action@v5
60+
if: always() # even if previous steps fail, this one needs to be run
61+
with:
62+
token: ${{ secrets.CODECOV_TOKEN }}
63+
# do not search for coverage files automatically, upload only specified files
64+
disable_search: true
65+
files: cobertura.xml
66+
# flags: unittests # optional
67+
name: codecov-umbrella # optional
68+
fail_ci_if_error: true # optional (default = false)
69+
verbose: true # optional (default = false)
70+
- name: upload test report to codecov.io
71+
if: always() # even if previous steps fail, this one needs to be run
72+
uses: codecov/test-results-action@v1
73+
with:
74+
token: ${{ secrets.CODECOV_TOKEN }}
75+
# do not search for coverage files automatically, upload only specified files
76+
disable_search: true
77+
files: tests/unit/out/gcov/junit.xml
78+
name: codecov-umbrella # optional
79+
fail_ci_if_error: true # optional (default = false)
80+
verbose: true # optional (default = false)
1381
##### sanitizer #####
1482
sanitizer:
1583
strategy:
1684
fail-fast: false
1785
matrix:
1886
include:
19-
- {os: debian, codename: bookworm, image_owner: , package_type: deb}
20-
- {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [arm32,docker]}
87+
- {os: debian, codename: bookworm, image_owner: }
88+
- {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
89+
- {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
2190
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
2291
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
2392
name: sanitizer - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
@@ -29,6 +98,12 @@ jobs:
2998
repo-name: cppfw
3099
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
31100
install: myci git
101+
- name: add llvm repo (for clang-format)
102+
uses: myci-actions/add-deb-repo@main
103+
with:
104+
repo: deb http://apt.llvm.org/${{ matrix.codename }} llvm-toolchain-${{ matrix.codename }} main
105+
repo-name: llvm
106+
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
32107
- name: install ci tools
33108
run: |
34109
apt install --assume-yes devscripts equivs
@@ -50,21 +125,21 @@ jobs:
50125
include:
51126
# - {os: debian, codename: buster, image_owner: , package_type: deb}
52127
# - {os: debian, codename: buster, image_owner: i386/, package_type: deb, labels: [i386,docker]}
53-
# - {os: debian, codename: buster, image_owner: arm32v7/, package_type: deb, labels: [arm,docker]}
128+
# - {os: debian, codename: buster, image_owner: arm32v7/, package_type: deb, labels: [ubuntu-24.04-arm]}
54129
# - {os: debian, codename: bullseye, image_owner: , package_type: deb}
55130
# - {os: debian, codename: bullseye, image_owner: i386/, package_type: deb, labels: [i386,docker]}
56-
# - {os: debian, codename: bullseye, image_owner: arm32v7/, package_type: deb, labels: [arm,docker]}
57-
# - {os: debian, codename: bullseye, image_owner: arm64v8/, package_type: deb, labels: [arm64,docker]}
131+
# - {os: debian, codename: bullseye, image_owner: arm32v7/, package_type: deb, labels: [ubuntu-24.04-arm]}
132+
# - {os: debian, codename: bullseye, image_owner: arm64v8/, package_type: deb, labels: [ubuntu-24.04-arm]}
58133
- {os: debian, codename: bookworm, image_owner: , package_type: deb}
59134
# - {os: debian, codename: bookworm, image_owner: i386/, package_type: deb, labels: [i386,docker]}
60-
- {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [arm32,docker]}
61-
- {os: debian, codename: bookworm, image_owner: arm64v8/, package_type: deb, labels: [arm64,docker]}
135+
- {os: debian, codename: bookworm, image_owner: arm32v7/, package_type: deb, labels: [ubuntu-24.04-arm]}
136+
- {os: debian, codename: bookworm, image_owner: arm64v8/, package_type: deb, labels: [ubuntu-24.04-arm]}
62137
# - {os: ubuntu, codename: focal, image_owner: , package_type: deb}
63138
# - {os: ubuntu, codename: jammy, image_owner: , package_type: deb}
64139
- {os: ubuntu, codename: noble, image_owner: , package_type: deb}
65-
# - {os: raspbian, codename: buster, image_owner: igagis/, package_type: deb, labels: [arm,docker]}
66-
# - {os: raspbian, codename: bullseye, image_owner: igagis/, package_type: deb, labels: [arm,docker]}
67-
- {os: raspbian, codename: bookworm, image_owner: igagis/, package_type: deb, labels: [arm32,docker]}
140+
# - {os: raspbian, codename: buster, image_owner: igagis/, package_type: deb, labels: [ubuntu-24.04-arm]}
141+
# - {os: raspbian, codename: bullseye, image_owner: igagis/, package_type: deb, labels: [ubuntu-24.04-arm]}
142+
# - {os: raspbian, codename: bookworm, image_owner: igagis/, package_type: deb, labels: [ubuntu-24.04-arm]}
68143
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
69144
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
70145
name: linux - ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
@@ -84,17 +159,19 @@ jobs:
84159
uses: myci-actions/checkout@main
85160
- name: set PACKAGE_VERSION
86161
uses: myci-actions/export-env-var@main
87-
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh debian/changelog)}
162+
with: {name: PACKAGE_VERSION, value: $(myci-deb-version.sh)}
88163
- name: prepare debian package
89164
run: myci-deb-prepare.sh
90165
- name: install deps
91166
run: myci-deb-install-build-deps.sh
92167
- name: build
93-
run: dpkg-buildpackage --unsigned-source --unsigned-changes
168+
run:
169+
cd build
170+
dpkg-buildpackage --unsigned-source --unsigned-changes
94171
- name: deploy deb packages
95172
run: |
96173
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
97-
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main ../lib${PACKAGE_NAME}*_${PACKAGE_VERSION}_*.*deb
174+
myci-deploy-apt-ssh.sh --key repo_key_rsa --server gagis.hopto.org --repo cppfw/${{ matrix.os }} --distro ${{ matrix.codename }} --component main lib${PACKAGE_NAME}*_${PACKAGE_VERSION}_*.*deb
98175
if: matrix.package_type == 'deb' && startsWith(github.ref, 'refs/tags/')
99176
##### macosx #####
100177
macosx:
@@ -184,17 +261,17 @@ jobs:
184261
- name: git clone
185262
uses: myci-actions/checkout@main
186263
- name: prepare pacman package
187-
run: myci-apply-version.sh --version $(myci-deb-version.sh debian/changelog) msys2/PKGBUILD.in
264+
run: myci-apply-version.sh build/msys2/PKGBUILD.in
188265
- name: build
189266
# to make makepkg-mingw build only one architecture we need to set the MINGW_INSTALLS
190267
env: {MINGW_INSTALLS: '${{ matrix.repo }}'}
191268
run: |
192-
cd msys2
269+
cd build/msys2
193270
PKGEXT='.pkg.tar.xz' autojobs=true makepkg-mingw --syncdeps --noconfirm --skipinteg
194271
- name: deploy
195272
run: |
196273
echo "${{ secrets.MYCI_REPO_SSH_KEY }}" > repo_key_rsa && chmod 600 repo_key_rsa
197-
for f in $(find msys2 -name "mingw-w64-${{ matrix.arch }}-$PACKAGE_NAME-*-any.pkg.*"); do
274+
for f in $(find build/msys2 -name "mingw-w64-${{ matrix.arch }}-$PACKAGE_NAME-*-any.pkg.*"); do
198275
myci-deploy-pacman-ssh.sh --server gagis.hopto.org --key repo_key_rsa --repo cppfw/msys2/${{ matrix.repo }} --database cppfw_${{ matrix.repo }} $f
199276
done
200277
if: startsWith(github.ref, 'refs/tags/')

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "tool-configs"]
2+
path = tool-configs
3+
url = ../tool-configs
4+
branch = main
File renamed without changes.
File renamed without changes.

debian/control.in renamed to build/debian/control.in

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,45 @@ Standards-Version: 3.9.2
1717
Package: libhttpc$(soname)
1818
Section: libs
1919
Architecture: any
20-
Depends: ${shlibs:Depends}, ${misc:Depends}
20+
Depends:
21+
${shlibs:Depends},
22+
${misc:Depends}
2123
Description: cross-platform HTTP client library in C++.
22-
Cross-platform HTTP/HTTPS client library in C++. Mainly, this is a wrapper above libcurl.
24+
Cross-platform HTTP/HTTPS client library in C++. Mainly, this is a wrapper above libcurl.
2325

24-
Package: libhttpc$(soname)-dbg
25-
Section: debug
26+
Package: libhttpc-dbg$(soname)
27+
Section: libs
2628
Architecture: any
27-
Depends: libhttpc$(soname) (= ${binary:Version}), ${misc:Depends}
28-
Description: debugging symbols for libhttpc$(soname) package.
29+
Depends:
30+
${shlibs:Depends},
31+
${misc:Depends}
32+
Description: cross-platform HTTP client library in C++.
33+
Debug version of libhttpc.
2934

3035
Package: libhttpc-dev
3136
Section: libdevel
3237
Architecture: any
3338
Depends:
34-
libhttpmodel-dev,
35-
libhttpc$(soname) (= ${binary:Version}), libhttpc$(soname)-dbg (= ${binary:Version}), ${misc:Depends}
39+
libhttpc$(soname) (= ${binary:Version}),
40+
libhttpc-dbg$(soname) (= ${binary:Version}),
41+
${misc:Depends}
42+
libhttpmodel-dev
3643
Suggests: libhttpc-doc
3744
Description: cross-platform HTTP client library in C++, development files.
38-
Development files for libhttpc$(soname).
45+
Development files for libhttpc$(soname).
46+
47+
Package: libhttpc$(soname)-dbgsrc
48+
Section: debug
49+
Architecture: all
50+
Depends:
51+
libhttpc$(soname)-dbgsym (= ${binary:Version}),
52+
libhttpc-dbg$(soname)-dbgsym (= ${binary:Version}),
53+
${misc:Depends}
54+
Description: debugging sources for libhttpc$(soname) package.
3955

4056
Package: libhttpc-doc
4157
Section: doc
4258
Architecture: all
4359
Depends: ${misc:Depends}
4460
Description: documentation for libhttpc-dev package.
45-
For more details see description to libhttpc-dev package.
61+
For more details see description to libhttpc-dev package.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/src/*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib/libhttpc.so.*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib/lib*-dbg.so.*

0 commit comments

Comments
 (0)