1
- name : linux-gcc
1
+ name : linux
2
2
3
- on : [ pull_request ]
3
+ on : [ pull_request, workflow_dispatch ]
4
4
5
5
env :
6
6
VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
7
7
8
8
jobs :
9
- linux-gcc :
10
- runs-on : ubuntu-latest
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 : gcc
19
+ compiler-version : 11
20
+ additional-dep : " g++-11"
21
+ - compiler : gcc
22
+ compiler-version : 12
23
+ - compiler : gcc
24
+ compiler-version : 14
25
+ name : " ${{ github.job }} (${{ matrix.compiler }}-${{ matrix.compiler-version }})"
26
+ runs-on : ubuntu-24.04
11
27
steps :
12
28
- name : Checkout
13
- uses : actions/checkout@v3
29
+ uses : actions/checkout@v4
14
30
with :
15
31
submodules : recursive
16
32
fetch-depth : 0
@@ -20,29 +36,34 @@ jobs:
20
36
script : |
21
37
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
22
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"
23
44
- name : Run vcpkg
24
45
uses : lukka/run-vcpkg@v11
25
- - name : install dependencies
46
+ - name : Install dependencies
26
47
run : |
27
48
sudo apt update
28
- sudo apt install -y g++
29
- - name : Compile
49
+ sudo apt install -y ninja-build ${{ matrix.additional-dep }}
50
+ - name : Compile
30
51
run : |
31
- g++ --version
32
- cmake -S . -B build -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=ON -DREFLECTCPP_CBOR=ON -DREFLECTCPP_FLEXBUFFERS=ON -DREFLECTCPP_MSGPACK=ON -DREFLECTCPP_TOML=ON -DREFLECTCPP_XML=ON -DREFLECTCPP_YAML=ON -DCMAKE_BUILD_TYPE=Release
33
- cmake --build build -j 4
34
- - name : Run tests
52
+ if [[ "${{ matrix.compiler }}" == "llvm" ]]; then
53
+ export CC=clang-${{ matrix.compiler-version }}
54
+ export CXX=clang++-${{ matrix.compiler-version }}
55
+ elif [[ "${{ matrix.compiler }}" == "gcc" ]]; then
56
+ export CC=gcc-${{ matrix.compiler-version }}
57
+ export CXX=g++-${{ matrix.compiler-version }}
58
+ fi
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 -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_BSON=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
35
65
run : |
36
- ./build/tests/bson/reflect-cpp-bson-tests
37
- ./build/tests/cbor/reflect-cpp-cbor-tests
38
- ./build/tests/flexbuffers/reflect-cpp-flexbuffers-tests
39
- ./build/tests/generic/reflect-cpp-generic-tests
40
- ./build/tests/json/reflect-cpp-json-tests
41
- ./build/tests/json_c_arrays_and_inheritance/reflect-cpp-json-c-arrays-and-inheritance-tests
42
- ./build/tests/msgpack/reflect-cpp-msgpack-tests
43
- ./build/tests/toml/reflect-cpp-toml-tests
44
- ./build/tests/xml/reflect-cpp-xml-tests
45
- ./build/tests/yaml/reflect-cpp-yaml-tests
66
+ ctest --test-dir build --output-on-failure
46
67
- name : Run benchmarks
47
68
run : |
48
69
echo '# Benchmarks' >> $GITHUB_STEP_SUMMARY
61
82
./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=canada >> $GITHUB_STEP_SUMMARY
62
83
./build/benchmarks/json/reflect-cpp-json-benchmarks --benchmark_filter=licenses >> $GITHUB_STEP_SUMMARY
63
84
echo '```' >> $GITHUB_STEP_SUMMARY
64
-
65
-
0 commit comments