Skip to content

Commit 2abde1b

Browse files
authored
Merge pull request #493 from biojppm/fix/476_byte_order_mark
2 parents 0f93764 + 7911f37 commit 2abde1b

File tree

23 files changed

+840
-214
lines changed

23 files changed

+840
-214
lines changed

.github/workflows/coverage.yml

Lines changed: 75 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -21,81 +21,100 @@ jobs:
2121
coverage:
2222
if: always()
2323
continue-on-error: false
24-
name: coverage/c++${{matrix.std}}${{matrix.namesfx}}
25-
runs-on: ${{matrix.os}}
24+
name: cov/c++${{matrix.std}}/${{matrix.namesfx}}
25+
runs-on: ubuntu-24.04
2626
strategy:
2727
fail-fast: false
2828
matrix:
2929
include:
3030
- std: 11
31-
cxx: g++-9
32-
bt: Coverage
33-
os: ubuntu-20.04
31+
namesfx: 64bit
32+
cmk: -DCMAKE_CXX_FLAGS=-m64
33+
- std: 11
34+
namesfx: 64bit_dbg
35+
cmk: -DCMAKE_CXX_FLAGS=-m64 -DRYML_DBG=ON
36+
- std: 17
37+
namesfx: 64bit
38+
cmk: -DCMAKE_CXX_FLAGS=-m64
3439
- std: 17
35-
cxx: g++-9
36-
bt: Coverage
37-
os: ubuntu-20.04
40+
namesfx: 64bit_dbg
41+
cmk: -DCMAKE_CXX_FLAGS=-m64 -DRYML_DBG=ON
3842
- std: 11
39-
cxx: g++-9
40-
bt: Coverage
41-
os: ubuntu-20.04
42-
cmk: -DRYML_DBG=ON
43-
namesfx: /dbg
43+
namesfx: 32bit
44+
cmk: -DCMAKE_CXX_FLAGS=-m32
45+
- std: 11
46+
namesfx: 32bit_dbg
47+
cmk: -DCMAKE_CXX_FLAGS=-m32 -DRYML_DBG=ON
48+
- std: 17
49+
namesfx: 32bit
50+
cmk: -DCMAKE_CXX_FLAGS=-m32
4451
- std: 17
45-
cxx: g++-9
46-
bt: Coverage
47-
os: ubuntu-20.04
48-
cmk: -DRYML_DBG=ON
49-
namesfx: /dbg
52+
namesfx: 32bit_dbg
53+
cmk: -DCMAKE_CXX_FLAGS=-m32 -DRYML_DBG=ON
5054
env:
51-
STD: ${{matrix.std}}
52-
CXX_: ${{matrix.cxx}}
53-
BT: ${{matrix.bt}}
54-
BITLINKS: ${{matrix.bitlinks}}
55-
VG: ${{matrix.vg}}
56-
SAN: ${{matrix.san}}
57-
LINT: ${{matrix.lint}}
58-
OS: ${{matrix.os}}
59-
CMAKE_FLAGS: ${{matrix.cmk}}
55+
GCC_VERSION: 13
56+
LCOV_ARGS: -v --ignore-errors mismatch,mismatch --ignore-errors unused,unused
57+
BUILD_ID: cpp${{matrix.std}}_${{matrix.namesfx}}
6058
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
61-
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
6259
steps:
6360
- name: checkout (action)
6461
uses: actions/checkout@v4
6562
with:
6663
submodules: recursive
6764
fetch-depth: 0
68-
- name: install requirements
69-
run: source .github/reqs.sh && c4_install_test_requirements $OS
65+
- name: install compiler
66+
run: |
67+
sudo dpkg --add-architecture i386
68+
sudo apt-get update
69+
sudo apt-get install -y \
70+
build-essential \
71+
cmake \
72+
git \
73+
lcov \
74+
linux-libc-dev:i386 \
75+
libc6:i386 \
76+
libc6-dev:i386 \
77+
libc6-dbg:i386 \
78+
g++-$GCC_VERSION \
79+
g++-$GCC_VERSION-multilib
7080
- name: show info
7181
run: source .github/setenv.sh && c4_show_info
72-
- name: static64-configure-------------------------------------------------
73-
run: source .github/setenv.sh && c4_cfg_test static64
74-
- name: static64-build
75-
run: source .github/setenv.sh && c4_build_test static64
76-
- name: static64-run
77-
run: source .github/setenv.sh && c4_build_target static64 ryml-coverage
78-
- name: static64-coverage-artifacts
82+
- name: configure
83+
run: |
84+
cmake -B build/$BUILD_ID \
85+
-DCMAKE_BUILD_TYPE=Coverage \
86+
-DRYML_BUILD_TESTS=ON \
87+
-DRYML_COVERAGE_LCOV_ARGS=" $LCOV_ARGS " \
88+
-DRYML_COVERAGE_CODECOV=ON \
89+
${{matrix.cmk}}
90+
- name: build
91+
run: |
92+
cmake --build build/$BUILD_ID --verbose --target ryml-test-build --parallel
93+
- name: run
94+
run: |
95+
cmake --build build/$BUILD_ID --verbose --target ryml-coverage
96+
- name: upload artifacts
7997
uses: actions/upload-artifact@v4
8098
with:
81-
name: coverage-static64-${{strategy.job-index}}
99+
name: coverage-${{env.BUILD_ID}}
82100
path: |
83-
build/static64/lcov
84-
build/static64/coverage3-final_filtered.lcov
85-
- name: static64-submit-codecov
86-
run: source .github/setenv.sh && c4_submit_coverage static64 codecov
87-
- name: static32-configure-------------------------------------------------
88-
run: source .github/setenv.sh && c4_cfg_test static32
89-
- name: static32-build
90-
run: source .github/setenv.sh && c4_build_test static32
91-
- name: static32-run
92-
run: source .github/setenv.sh && c4_build_target static32 ryml-coverage
93-
- name: static32-coverage-artifacts
94-
uses: actions/upload-artifact@v4
101+
build/$BUILD_ID/lcov
102+
build/$BUILD_ID/coverage3-final_filtered.lcov
103+
- name: upload codecov
104+
run: |
105+
cmake --build build/$BUILD_ID --target ryml-coverage-submit-codecov --verbose
106+
- name: upload coveralls
107+
uses: coverallsapp/github-action@v2
95108
with:
96-
name: coverage-static32-cxx${{matrix.std}}-${{strategy.job-index}}
97-
path: |
98-
build/static32/lcov
99-
build/static32/coverage3-final_filtered.lcov
100-
- name: static32-submit-codecov
101-
run: source .github/setenv.sh && c4_submit_coverage static32 codecov
109+
github-token: ${{secrets.COVERALLS_REPO_TOKEN}}
110+
parallel: true
111+
files: build/${{env.BUILD_ID}}/coverage3-final_filtered.lcov
112+
coveralls_finish:
113+
needs: coverage
114+
if: ${{always()}}
115+
runs-on: ubuntu-24.04
116+
steps:
117+
- name: Coveralls Finished
118+
uses: coverallsapp/github-action@v2
119+
with:
120+
parallel-finished: true

.github/workflows/coverage.ys

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -6,85 +6,83 @@
66
jobs:
77
coverage:
88
:: setup-job('coverage' 'coverage')
9-
name: coverage/c++${{matrix.std}}${{matrix.namesfx}}
10-
runs-on: ${{matrix.os}}
9+
name: cov/c++${{matrix.std}}/${{matrix.namesfx}}
10+
runs-on: ubuntu-24.04
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
item =: \({:std %1, :cxx 'g++-9', :bt 'Coverage', :os 'ubuntu-20.04'})
1514
include:
16-
- ! item(11)
17-
- ! item(17)
1815
# test also with the debug code enabled
19-
- ! item(11) + {:cmk '-DRYML_DBG=ON', :namesfx '/dbg'}
20-
- ! item(17) + {:cmk '-DRYML_DBG=ON', :namesfx '/dbg'}
21-
env: !:merge*
22-
- ! load('share/env.yaml')
23-
- CMAKE_FLAGS: ${{matrix.cmk}}
16+
- {std: 11, namesfx: 64bit , cmk: "-DCMAKE_CXX_FLAGS=-m64"}
17+
- {std: 11, namesfx: 64bit_dbg, cmk: "-DCMAKE_CXX_FLAGS=-m64 -DRYML_DBG=ON"}
18+
- {std: 17, namesfx: 64bit , cmk: "-DCMAKE_CXX_FLAGS=-m64"}
19+
- {std: 17, namesfx: 64bit_dbg, cmk: "-DCMAKE_CXX_FLAGS=-m64 -DRYML_DBG=ON"}
20+
- {std: 11, namesfx: 32bit , cmk: "-DCMAKE_CXX_FLAGS=-m32"}
21+
- {std: 11, namesfx: 32bit_dbg, cmk: "-DCMAKE_CXX_FLAGS=-m32 -DRYML_DBG=ON"}
22+
- {std: 17, namesfx: 32bit , cmk: "-DCMAKE_CXX_FLAGS=-m32"}
23+
- {std: 17, namesfx: 32bit_dbg, cmk: "-DCMAKE_CXX_FLAGS=-m32 -DRYML_DBG=ON"}
24+
env:
25+
GCC_VERSION: 13 # the default compiler
26+
LCOV_ARGS: -v --ignore-errors mismatch,mismatch --ignore-errors unused,unused
27+
BUILD_ID: cpp${{matrix.std}}_${{matrix.namesfx}}
2428
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
25-
COVERALLS_REPO_TOKEN: ${{secrets.COVERALLS_REPO_TOKEN}}
26-
# coveralls disabled:
27-
# https://github.com/lemurheavy/coveralls-public/issues/1665
28-
# https://docs.coveralls.io/parallel-build-webhook
29-
# COVERALLS_PARALLEL: true
3029
steps:
3130
- :: checkout-action
32-
- name: install requirements
33-
run: source .github/reqs.sh && c4_install_test_requirements $OS
31+
- name: install compiler
32+
run: |
33+
sudo dpkg --add-architecture i386
34+
sudo apt-get update
35+
sudo apt-get install -y \
36+
build-essential \
37+
cmake \
38+
git \
39+
lcov \
40+
linux-libc-dev:i386 \
41+
libc6:i386 \
42+
libc6-dev:i386 \
43+
libc6-dbg:i386 \
44+
g++-$GCC_VERSION \
45+
g++-$GCC_VERSION-multilib
3446
- name: show info
3547
run: source .github/setenv.sh && c4_show_info
36-
- name: static64-configure-------------------------------------------------
37-
run: source .github/setenv.sh && c4_cfg_test static64
38-
- name: static64-build
39-
run: source .github/setenv.sh && c4_build_test static64
40-
- name: static64-run
41-
run: source .github/setenv.sh && c4_build_target static64 ryml-coverage
42-
- name: static64-coverage-artifacts
48+
- name: configure
49+
run: |
50+
cmake -B build/$BUILD_ID \
51+
-DCMAKE_BUILD_TYPE=Coverage \
52+
-DRYML_BUILD_TESTS=ON \
53+
-DRYML_COVERAGE_LCOV_ARGS=" $LCOV_ARGS " \
54+
-DRYML_COVERAGE_CODECOV=ON \
55+
${{matrix.cmk}}
56+
- name: build
57+
run: |
58+
cmake --build build/$BUILD_ID --verbose --target ryml-test-build --parallel
59+
- name: run
60+
run: |
61+
cmake --build build/$BUILD_ID --verbose --target ryml-coverage
62+
- name: upload artifacts
4363
uses: actions/upload-artifact@v4
4464
with:
45-
name: coverage-static64-${{strategy.job-index}}
65+
name: coverage-${{env.BUILD_ID}}
4666
path: |
47-
build/static64/lcov
48-
build/static64/coverage3-final_filtered.lcov
49-
- name: static64-submit-codecov
50-
run: source .github/setenv.sh && c4_submit_coverage static64 codecov
51-
# Coveralls disabled:
52-
# https://github.com/lemurheavy/coveralls-public/issues/1665
53-
#- name: static64-submit-coveralls
54-
# run: if [ ${{matrix.std}} == 17 ] ;
55-
# then ( source .github/setenv.sh &&
56-
# c4_submit_coverage static64 coveralls ) ; fi
57-
- name: static32-configure-------------------------------------------------
58-
run: source .github/setenv.sh && c4_cfg_test static32
59-
- name: static32-build
60-
run: source .github/setenv.sh && c4_build_test static32
61-
- name: static32-run
62-
run: source .github/setenv.sh && c4_build_target static32 ryml-coverage
63-
- name: static32-coverage-artifacts
64-
uses: actions/upload-artifact@v4
67+
build/$BUILD_ID/lcov
68+
build/$BUILD_ID/coverage3-final_filtered.lcov
69+
- name: upload codecov
70+
run: |
71+
cmake --build build/$BUILD_ID --target ryml-coverage-submit-codecov --verbose
72+
# https://docs.coveralls.io/parallel-builds
73+
- name: upload coveralls
74+
uses: coverallsapp/github-action@v2
6575
with:
66-
name: coverage-static32-cxx${{matrix.std}}-${{strategy.job-index}}
67-
path: |
68-
build/static32/lcov
69-
build/static32/coverage3-final_filtered.lcov
70-
- name: static32-submit-codecov
71-
run: source .github/setenv.sh && c4_submit_coverage static32 codecov
72-
# Coveralls disabled:
73-
# https://github.com/lemurheavy/coveralls-public/issues/1665
74-
#- name: static32-submit-coveralls
75-
# run: source .github/setenv.sh && c4_submit_coverage static32 coveralls
76+
github-token: ${{secrets.COVERALLS_REPO_TOKEN}}
77+
parallel: true
78+
files: build/${{env.BUILD_ID}}/coverage3-final_filtered.lcov
7679

77-
# coveralls disabled:
78-
# https://github.com/lemurheavy/coveralls-public/issues/1665
79-
# https://github.com/lemurheavy/coveralls-public/issues/1665
80-
#coveralls_finish:
81-
# needs: [coverage]
82-
# runs-on: ubuntu-latest
83-
#
84-
# steps:
85-
# - name: coveralls-notify
86-
# #continue-on-error: true
87-
# uses: coverallsapp/github-action@master
88-
# with:
89-
# github-token: ${{ secrets.github_token }}
90-
# parallel-finished: true
80+
coveralls_finish:
81+
needs: coverage
82+
if: ${{always()}}
83+
runs-on: ubuntu-24.04
84+
steps:
85+
- name: Coveralls Finished
86+
uses: coverallsapp/github-action@v2
87+
with:
88+
parallel-finished: true

.github/workflows/infra.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,57 @@ jobs:
4242
echo "ERROR: generated workflows are out of date"
4343
fi
4444
exit $status
45+
check_doc:
46+
if: always()
47+
continue-on-error: false
48+
runs-on: ubuntu-24.04
49+
env:
50+
DOXY_VERSION: 1.12.0
51+
DOXY_DIR: /tmp/doxydir/bin
52+
steps:
53+
- name: checkout (action)
54+
uses: actions/checkout@v4
55+
with:
56+
submodules: recursive
57+
fetch-depth: 0
58+
- name: install python
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: 3.9
62+
- name: install requirements
63+
run: pip install -r doc/requirements.txt
64+
- name: install wget
65+
run: |
66+
sudo apt-get update
67+
sudo apt install -y wget
68+
- name: install doxygen
69+
run: |
70+
ver=$DOXY_VERSION
71+
uver=$(echo $ver | sed "s:\.:_:g")
72+
name=$(dirname $DOXY_DIR)
73+
dst=$(dirname $name)
74+
url="https://github.com/doxygen/doxygen/releases/download/Release_$uver/doxygen-$ver.linux.bin.tar.gz"
75+
( \
76+
cd $dst ; \
77+
wget $url ; \
78+
tar xvfz $(basename $url) ; \
79+
ls -lFhp | grep dox ; \
80+
mv -v doxygen-$ver $name ; \
81+
)
82+
- name: doxygen version
83+
run: |
84+
export PATH=$DOXY_DIR:$PATH
85+
which doxygen
86+
doxygen --version
87+
- name: check doxygen docs
88+
run: |
89+
export PATH=$DOXY_DIR:$PATH
90+
# put doxygen to fail if there are warnings
91+
sed "s/WARN_AS_ERROR.*= .*/WARN_AS_ERROR = FAIL_ON_WARNINGS_PRINT/g" -i doc/Doxyfile
92+
make -C doc doxy
93+
- name: check sphinx
94+
run: |
95+
# put doxygen to not fail if there are warnings.
96+
sed "s/WARN_AS_ERROR.*= .*/WARN_AS_ERROR = NO/g" -i doc/Doxyfile
97+
export PATH=$DOXY_DIR:$PATH
98+
make -C doc html

0 commit comments

Comments
 (0)