1- name : CMake
1+ name : Build and test
22
33on : [push, pull_request]
44
5- env :
6- BUILD_TYPE : Release
7-
85jobs :
96 ubuntu-build :
107 name : Build - Ubuntu
118 strategy :
129 matrix :
13- config :
14- - {os: 'ubuntu-20.04', compiler: {c: gcc, cxx: g++}}
15- - {os: 'ubuntu-22.04', compiler: {c: gcc, cxx: g++}}
16- - {os: 'ubuntu-22.04', compiler: {c: clang, cxx: clang++}}
17- runs-on : ${{matrix.config.os}}
10+ os : ['ubuntu-20.04', 'ubuntu-22.04']
11+ build_type : [Debug, Release]
12+ compiler : [{c: gcc, cxx: g++}]
13+ libbacktrace : ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF']
14+ include :
15+ - os : ' ubuntu-22.04'
16+ build_type : Release
17+ compiler : {c: clang, cxx: clang++}
18+ libbacktrace : ' -DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF'
19+ - os : ' ubuntu-22.04'
20+ build_type : Release
21+ compiler : {c: gcc, cxx: g++}
22+ libbacktrace : ' -DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
23+ - os : ' ubuntu-22.04'
24+ build_type : Release
25+ compiler : {c: clang, cxx: clang++}
26+ libbacktrace : ' -DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
27+
28+ runs-on : ${{matrix.os}}
1829
1930 steps :
2031 - uses : actions/checkout@v3
@@ -27,37 +38,47 @@ jobs:
2738 - name : Install pip packages
2839 run : pip install -r third_party/requirements.txt
2940
41+ - name : Install libbacktrace
42+ if : matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON'
43+ run : |
44+ git clone https://github.com/ianlancetaylor/libbacktrace.git
45+ cd libbacktrace
46+ ./configure
47+ make
48+ sudo make install
49+ cd ..
50+
3051 - name : Configure CMake
3152 run : >
3253 cmake
3354 -B${{github.workspace}}/build
34- -DCMAKE_C_COMPILER=${{matrix.config. compiler.c}}
35- -DCMAKE_CXX_COMPILER=${{matrix.config. compiler.cxx}}
55+ -DCMAKE_C_COMPILER=${{matrix.compiler.c}}
56+ -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
3657 -DUR_ENABLE_TRACING=ON
3758 -DUR_DEVELOPER_MODE=ON
38- -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE }}
59+ -DCMAKE_BUILD_TYPE=${{matrix.build_type }}
3960 -DUR_BUILD_TESTS=ON
4061 -DUR_FORMAT_CPP_STYLE=ON
62+ ${{matrix.libbacktrace}}
4163
4264 - name : Generate source from spec, check for uncommitted diff
43- if : matrix.config. os == 'ubuntu-22.04'
65+ if : matrix.os == 'ubuntu-22.04'
4466 run : cmake --build ${{github.workspace}}/build --target check-generated
4567
4668 - name : Build
47- run : cmake --build ${{github.workspace}}/build
69+ run : cmake --build ${{github.workspace}}/build -j $(nproc)
4870
4971 - name : Test
5072 working-directory : ${{github.workspace}}/build
51- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure -L "python|uma|loader|validation|tracing|unit|urtrace"
73+ run : ctest -C ${{matrix.build_type }} --output-on-failure -L "python|uma|loader|validation|tracing|unit|urtrace"
5274
5375 windows-build :
5476 name : Build - Windows
5577 strategy :
5678 matrix :
57- config :
58- - {os: 'windows-2019'}
59- - {os: 'windows-2022'}
60- runs-on : ${{matrix.config.os}}
79+ os : ['windows-2019', 'windows-2022']
80+ build_type : [Debug, Release]
81+ runs-on : ${{matrix.os}}
6182
6283 steps :
6384 - uses : actions/checkout@v3
@@ -80,12 +101,12 @@ jobs:
80101 -DUR_FORMAT_CPP_STYLE=ON
81102
82103 - name : Generate source from spec, check for uncommitted diff
83- if : matrix.config. os == 'windows-2022'
84- run : cmake --build ${{github.workspace}}/build --target check-generated --config ${{env.BUILD_TYPE }}
104+ if : matrix.os == 'windows-2022'
105+ run : cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type }}
85106
86107 - name : Build all
87- run : cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
108+ run : cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j 2
88109
89110 - name : Test
90111 working-directory : ${{github.workspace}}/build
91- run : ctest -C ${{env.BUILD_TYPE }} --output-on-failure -L "python|uma|loader|validation|tracing|unit|urtrace"
112+ run : ctest -C ${{matrix.build_type }} --output-on-failure -L "python|uma|loader|validation|tracing|unit|urtrace"
0 commit comments