Skip to content

Commit 7040bb9

Browse files
Split into clang and GCC
1 parent 661c194 commit 7040bb9

File tree

2 files changed

+89
-7
lines changed

2 files changed

+89
-7
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: linux-cxx20
2+
3+
on: [ push ]
4+
5+
env:
6+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
7+
8+
jobs:
9+
linux:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- compiler: llvm
15+
compiler-version: 16
16+
- compiler: llvm
17+
compiler-version: 18
18+
- compiler: llvm
19+
compiler-version: 20
20+
name: "${{ github.job }} (${{ matrix.compiler }}-${{ matrix.compiler-version }})"
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
with:
26+
submodules: recursive
27+
fetch-depth: 0
28+
- name: Set up Clang
29+
uses: egor-tensin/setup-clang@v1
30+
with:
31+
version: ${{ matrix.compiler-version }}
32+
platform: x64
33+
- name: Export GitHub Actions cache environment variables
34+
uses: actions/github-script@v7
35+
with:
36+
script: |
37+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
38+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
39+
- name: Setup ccache
40+
uses: hendrikmuhs/ccache-action@v1
41+
with:
42+
key: "${{ github.job }}-${{ matrix.compiler }}-${{ matrix.compiler-version }}"
43+
max-size: "2G"
44+
- name: Run vcpkg
45+
uses: lukka/run-vcpkg@v11
46+
- name: Install dependencies
47+
run: |
48+
sudo apt update
49+
sudo apt install -y ninja-build ${{ matrix.additional-dep }}
50+
- name: Install Conan
51+
run: |
52+
sudo apt install -y pipx
53+
pipx install conan
54+
conan profile detect
55+
- name: Make sure the library compiles with Conan
56+
run: conan build . --build=missing -s compiler.cppstd=gnu20 -o *:with_capnproto=True -o *:with_cbor=True -o *:with_flatbuffers=True -o *:with_msgpack=True -o *:with_toml=True -o *:with_ubjson=True -o *:with_xml=True -o *:with_yaml=True
57+
- name: Compile
58+
run: |
59+
sudo ln -s $(which ccache) /usr/local/bin/$CC
60+
sudo ln -s $(which ccache) /usr/local/bin/$CXX
61+
$CXX --version
62+
cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CAPNPROTO=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release
63+
cmake --build build
64+
- name: Run tests
65+
run: |
66+
ctest --test-dir build --output-on-failure
67+
- name: Run benchmarks
68+
run: |
69+
echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY
70+
echo '## Benchmarks across different formats' >> $GITHUB_STEP_SUMMARY
71+
echo '```' >> $GITHUB_STEP_SUMMARY
72+
./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_read >> $GITHUB_STEP_SUMMARY
73+
./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=canada_write >> $GITHUB_STEP_SUMMARY
74+
./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_read >> $GITHUB_STEP_SUMMARY
75+
./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=licenses_write >> $GITHUB_STEP_SUMMARY
76+
./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY
77+
./build/benchmarks/all/reflect-cpp-all-format-benchmarks --benchmark_filter=person_write >> $GITHUB_STEP_SUMMARY
78+
echo '```' >> $GITHUB_STEP_SUMMARY
79+
echo '## Benchmarks for JSON' >> $GITHUB_STEP_SUMMARY
80+
echo '```' >> $GITHUB_STEP_SUMMARY
81+
./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=person_read >> $GITHUB_STEP_SUMMARY
82+
./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY
83+
./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY
84+
echo '```' >> $GITHUB_STEP_SUMMARY

.github/workflows/linux-cxx20.yaml renamed to .github/workflows/linux-cxx20-gcc.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,8 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
include:
14-
- compiler: llvm
15-
compiler-version: 16
16-
- compiler: llvm
17-
compiler-version: 18
18-
- compiler: llvm
19-
compiler-version: 20
2014
- compiler: gcc
2115
compiler-version: 11
22-
additional-dep: "g++-11"
2316
- compiler: gcc
2417
compiler-version: 12
2518
- compiler: gcc
@@ -34,6 +27,11 @@ jobs:
3427
with:
3528
submodules: recursive
3629
fetch-depth: 0
30+
- name: Set up GCC
31+
uses: egor-tensin/setup-gcc@v1
32+
with:
33+
version: ${{ matrix.compiler-version }}
34+
platform: x64
3735
- name: Export GitHub Actions cache environment variables
3836
uses: actions/github-script@v7
3937
with:

0 commit comments

Comments
 (0)