Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change github action ubuntu version 18.04 -> latest #60

Merged
merged 28 commits into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0a88724
change github action ubuntu version 18.04 -> latest
injae Dec 30, 2023
bd02d0b
update catch2 2.9.1 -> 3.5.0
injae Dec 30, 2023
df400d6
fix catch2 include error
injae Dec 31, 2023
37296e0
change github action llvm install script
injae Dec 31, 2023
d70219d
change minimum llvm version 8 -> 9
injae Dec 31, 2023
8ed8a65
yaml-cpp version bugfix
injae Dec 31, 2023
cfdd19f
change catch2 module name Catch2::Catch2 -> Catch2::Catch2WithMain
injae Dec 31, 2023
8c0c27f
update github action
injae Dec 31, 2023
c52192b
change linux ci
injae Dec 31, 2023
f4884d5
fix clang ci matrix name
injae Dec 31, 2023
8e83276
remove ccache
injae Dec 31, 2023
6e7dd80
add step: git install
injae Dec 31, 2023
8e1509d
change code-cov llvm-cov -> lcov
injae Dec 31, 2023
ad587b5
fix cov-ci matrix name
injae Dec 31, 2023
fa101ae
remove sudo
injae Dec 31, 2023
c0989a1
remove coverage tests/*
injae Dec 31, 2023
5006158
remove coverage tests/*.cpp
injae Jan 1, 2024
5a07289
remove coverage thirdparty library
injae Jan 1, 2024
fd26354
update gcc debug compile option for coverage
injae Jan 1, 2024
d7661d7
remove .envrc
injae Jan 1, 2024
1159a20
remove flake.nix
injae Jan 1, 2024
cf274a0
add annotations maybe-unused in example reflection.cpp
injae Jan 1, 2024
e8b29a9
add test throw unknown_adaptor exception
injae Jan 1, 2024
ac48088
remove empty block
injae Jan 1, 2024
9b7d40b
add test reflection struct -> tuple
injae Jan 1, 2024
26bc07b
change coverage-bin gcov -> llvm-cov
injae Jan 1, 2024
aaf16df
cp coverage.info to project root
injae Jan 1, 2024
70dc991
update cppm.toml and remove gcc debug flags
injae Jan 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 47 additions & 43 deletions .github/workflows/code-cov.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
name: CodeCov

on: [pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
ubuntu-bionic-llvm-code-cov:
runs-on: ubuntu-18.04
ubuntu-code-cov:
runs-on: ubuntu-latest
env:
CMAKE_FLAGS: '-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON'
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON"
strategy:
matrix:
build-type: ['Debug']
clang-version: ['8']
build-type: ["Debug"]
compiler-version: ["latest"]
container: silkeh/clang:${{ matrix.compiler-version }}
steps:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: C++ Setting
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository -y "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${{matrix.clang-version}} main"
sudo apt-get update
sudo apt-get install -yq clang-${{matrix.clang-version}} libc++-dev libc++abi-dev libstdc++-${{matrix.clang-version}}-dev build-essential cmake
sudo apt-get install -yq libllvm${{matrix.clang-version}} llvm-${{matrix.clang-version}} llvm-${{matrix.clang-version}}-dev llvm-${{matrix.clang-version}}-runtime
- name: Compiler Setting
run: |
echo "CC=clang-${{matrix.clang-version}}" >> $GITHUB_ENV
echo "CXX=clang++-${{matrix.clang-version}}" >> $GITHUB_ENV
- name: Clone Repository
uses: actions/checkout@master
with:
submodules: true
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cd build
cmake --build . --config ${{matrix.build-type}}
- name: Generate Coverage Report
run: |
cd build/${{matrix.build-type}}
./unittest
llvm-profdata-${{matrix.clang-version}} merge -sparse default.profraw -o default.profdata
llvm-cov-${{matrix.clang-version}} export ./unittest --instr-profile default.profdata -format=lcov >> lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
directory: ./build/${{matrix.build-type}}
files: lcov.info
flags: unittest
fail_ci_if_error: true
verbose: true
- name: Get latest CMake
uses: lukka/[email protected]

- name: Install git on container
run: apt update && apt install -y git
- name: Clone Repository
uses: actions/checkout@v3
with:
submodules: true

- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cmake --build ./build --config ${{matrix.build-type}}

- name: Run Test Script
working-directory: build/${{matrix.build-type}}
run: |
./unittest
llvm-profdata merge -sparse default.profraw -o default.profdata
llvm-cov export ./unittest --instr-profile default.profdata -format=lcov >> coverage.info
cp coverage.info ../../

- name: Prepare Codecov
run: |
apt-get install -y lcov
lcov --remove coverage.info '/usr/*' --output-file coverage.info --rc lcov_branch_coverage=1
lcov --remove coverage.info '**/tests/*' --output-file coverage.info --rc lcov_branch_coverage=1
lcov --remove coverage.info '**/.cppm/*' --output-file coverage.info --rc lcov_branch_coverage=1
lcov --list coverage.info --rc lcov_branch_coverage=1
- name: Codecov
uses: codecov/[email protected]
with:
files: coverage.info
fail_ci_if_error: true
verbose: true
108 changes: 46 additions & 62 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,59 @@
name: Linux

on: [pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
ubuntu-bionic-gcc:
runs-on: ubuntu-18.04
ubuntu-gcc:
runs-on: ubuntu-latest
env:
CMAKE_FLAGS: '-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON'
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON"
strategy:
matrix:
build-type: ['Release', 'Debug']
gcc-version: ['11']
build-type: ["Release", "Debug"]
gcc-version: ["11", "12", "latest"]
container: gcc:${{ matrix.gcc-version }}
steps:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: C++ Setting
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -yq g++-${{matrix.gcc-version}} gcc-${{matrix.gcc-version}} libc++-dev libc++abi-dev build-essential libstdc++-${{matrix.gcc-version}}-dev cmake
- name: Compiler Setting
run: |
echo "CC=gcc-${{matrix.gcc-version}}" >> $GITHUB_ENV
echo "CXX=g++-${{matrix.gcc-version}}" >> $GITHUB_ENV
- name: Clone Repository
uses: actions/checkout@master
with:
submodules: true
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cd build
cmake --build . --config ${{matrix.build-type}}
- name: Run Test Script
run: |
cd build
ctest .
- name: Get latest CMake and ninja
uses: lukka/[email protected]
- name: Install git on container
run: apt update && apt install -y git
- uses: actions/checkout@v3
with:
submodules: true
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cmake --build ./build --config ${{matrix.build-type}}
- name: Run Test Script
working-directory: build
run: ctest -C ${{matrix.build-type}} --output-on-failure

ubuntu-bionic-llvm:
runs-on: ubuntu-18.04
ubuntu-llvm:
runs-on: ubuntu-latest
env:
CMAKE_FLAGS: '-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON'
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON"
strategy:
matrix:
build-type: ['Release', 'Debug']
clang-version: ['8']
build-type: ["Release", "Debug"]
clang-version: ["8", "9", "10", "11", "12", "13", "latest"] #"14", "15-bullseye", "latest"]
container: silkeh/clang:${{ matrix.clang-version }}
steps:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: C++ Setting
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository -y "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-${{matrix.clang-version}} main"
sudo apt-get update
sudo apt-get install -yq clang-${{matrix.clang-version}} libc++-dev libc++abi-dev libstdc++-${{matrix.clang-version}}-dev build-essential cmake
- name: Compiler Setting
run: |
echo "CC=clang-${{matrix.clang-version}}" >> $GITHUB_ENV
echo "CXX=clang++-${{matrix.clang-version}}" >> $GITHUB_ENV
- name: Clone Repository
uses: actions/checkout@master
with:
submodules: true
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cd build
cmake --build . --config ${{matrix.build-type}}
- name: Run Test Script
run: |
cd build
ctest .

- name: Get latest CMake
uses: lukka/[email protected]
- name: Install git on container
run: apt update && apt install -y git
- name: Clone Repository
uses: actions/checkout@v3
with:
submodules: true
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cmake --build ./build --config ${{matrix.build-type}}
- name: Run Test Script
working-directory: build
run: ctest -C ${{matrix.build-type}} --output-on-failure
55 changes: 29 additions & 26 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
name: MacOS

on: [pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
macos-clang:
runs-on: macos-latest
env:
CMAKE_FLAGS: '-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON'
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON"
strategy:
matrix:
build-type: ['Release', 'Debug']
build-type: ["Release", "Debug"]
steps:
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: Clone Repository
uses: actions/checkout@master
with:
submodules: true
- name: C++ Setting
run: |
brew install llvm cmake
- name: Compiler Setting
run: |
echo "CC=/usr/local/opt/llvm/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/local/opt/llvm/bin/clang++" >> $GITHUB_ENV
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cd build
cmake --build . --config ${{matrix.build-type}}
- name: Run Test Script
run: |
cd build
ctest .

- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: Clone Repository
uses: actions/checkout@master
with:
submodules: true
- name: C++ Setting
run: |
brew install llvm cmake
- name: Compiler Setting
run: |
echo "CC=/usr/local/opt/llvm/bin/clang" >> $GITHUB_ENV
echo "CXX=/usr/local/opt/llvm/bin/clang++" >> $GITHUB_ENV
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}} .
cd build
cmake --build . --config ${{matrix.build-type}}
- name: Run Test Script
run: |
cd build
ctest .
36 changes: 20 additions & 16 deletions .github/workflows/window.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
name: Windows

on: [pull_request]
on:
push:
branches:
- main
pull_request:

jobs:
windows-msvc:
runs-on: windows-2019
env:
CMAKE_FLAGS: '-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON'
CMAKE_FLAGS: "-DSERDEPP_USE_NLOHMANN_JSON=ON -DSERDEPP_USE_TOML11=ON -DSERDEPP_USE_YAML-CPP=ON -DSERDEPP_BUILD_EXAMPLES=ON -DSERDEPP_USE_RAPIDJSON=ON -DSERDEPP_USE_FMT=ON -DSERDEPP_BUILD_TESTING=ON -DSERDEPP_USE_CATCH2=ON"
strategy:
matrix:
build-type: ['Release', 'Debug']
build-type: ["Release", "Debug"]
steps:
- name: Clone Repository
uses: actions/checkout@master
with:
submodules: true
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}}.
cd build
cmake --build . --config ${{matrix.build-type}}
- name: Run Test Script
run: |
cd build
ctest .
- name: Clone Repository
uses: actions/checkout@master
with:
submodules: true
- name: CMake build
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.build-type}} ${{env.CMAKE_FLAGS}}.
cd build
cmake --build . --config ${{matrix.build-type}}
- name: Run Test Script
run: |
cd build
ctest .
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ cppm_setting()
cppm_cxx_standard(17)
cppm_compiler_option(
DEBUG
CLANG "-fprofile-instr-generate -fcoverage-mapping"
CLANG "-fprofile-instr-generate -fcoverage-mapping --coverage"
)

find_cppkg(benchmark 1.5.2 MODULE benchmark::benchmark TYPE lib OPTIONAL OFF)
find_cppkg(RapidJSON 1.1.1 MODULE rapidjson TYPE lib OPTIONAL OFF)
find_cppkg(nlohmann_json 3.10.5 MODULE nlohmann_json::nlohmann_json TYPE lib OPTIONAL OFF)
find_cppkg(Catch2 2.9.1 MODULE Catch2::Catch2 TYPE lib OPTIONAL OFF)
find_cppkg(Catch2 3.5.0 MODULE Catch2::Catch2WithMain TYPE lib OPTIONAL OFF)
find_cppkg(toml11 3.7.0 MODULE toml11::toml11 TYPE lib OPTIONAL OFF)
find_cppkg(yaml-cpp 0.7.0 MODULE yaml-cpp TYPE lib OPTIONAL OFF)
find_cppkg(yaml-cpp 0.6.3 MODULE yaml-cpp TYPE lib OPTIONAL OFF)
find_cppkg(fmt 8.0.1 MODULE fmt::fmt-header-only TYPE lib OPTIONAL OFF)
find_cppkg(magic_enum 0.7.3 MODULE magic_enum::magic_enum TYPE lib)
find_cppkg(nameof 0.10.0 MODULE nameof::nameof TYPE lib)
Expand Down Expand Up @@ -93,8 +93,8 @@ if(SERDEPP_BUILD_TESTING)

cppm_target_define(unittest BINARY
SOURCES
tests/serializer.cpp
tests/rapid_json.cpp
tests/catch_main.cpp
tests/yaml_cpp.cpp
tests/toml11.cpp
tests/reflection.cpp
Expand Down
6 changes: 3 additions & 3 deletions cppm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# include=["cmake/Lua.cmake"]

[profile.dev.compiler]
clang = "-fprofile-instr-generate -fcoverage-mapping"
clang = "-fprofile-instr-generate -fcoverage-mapping --coverage"

[lib]
name = "serdepp"
Expand Down Expand Up @@ -93,12 +93,12 @@ source = ["tests/.*"]
nameof = { version="0.10.0", link="public"}
magic_enum = { version= "0.7.3", link="public"}
fmt = {version="8.0.1", link="public", optional=true}
yaml-cpp = { version="0.7.0", link="public", optional=true}
yaml-cpp = { version="0.6.3", link="public", optional=true}
toml11 = { version="3.7.0", link="public", optional=true}
nlohmann_json = { version="3.10.5", link="public", optional=true}
RapidJSON = { version="1.1.1", link="public", optional=true}
benchmark = { version="1.5.2", optional=true}
Catch2 = {version="2.9.1", optional=true}
Catch2 = {version="3.5.0", optional=true}
#pybind11 = "2.9.0"
#hiredis = "git"
#"redis++" = "1.3.2"
Expand Down
4 changes: 2 additions & 2 deletions examples/reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ int main(int argc, char* argv[]) {
member_b_info = 3.14;

auto member_d_info = info.member_info<3>(a);
std::string_view member_d_name = member_d_info.name();
std::vector<int>& member_d = member_d_info.value();
[[maybe_unused]] std::string_view member_d_name = member_d_info.name();
[[maybe_unused]] std::vector<int>& member_d = member_d_info.value();

auto names = info.member_names();
for(auto& name : names.members()) {
Expand Down
Loading