11name : libintx CI
22
3- on : [push]
4-
5- env :
6- CMAKE_BUILD_PARALLEL_LEVEL : 4
3+ on :
4+ pull_request :
5+ push :
6+ branches : [main]
77
88defaults :
99 run :
@@ -16,31 +16,79 @@ jobs:
1616 strategy :
1717 fail-fast : false
1818 matrix :
19- os : [ macos-15 ]
20- cxx : [ clang++ ]
21- build_type : [ Debug ]
19+ os :
20+ - ubuntu-latest
21+
22+ compiler :
23+ - llvm
24+ - gcc
2225
23- name : " ${{ matrix.os }}: ${{ matrix.cxx }} ${{ matrix.build_type }}"
26+ build_type :
27+ - Debug
28+ - Release
29+
30+ simd :
31+ - ON
32+ - OFF
33+
34+ name : " ${{ matrix.os }}: ${{ matrix.compiler }} ${{ matrix.build_type }} ${{matrix.simd == 'ON' && '(simd)' || ''}}"
2435 runs-on : ${{ matrix.os }}
25- env :
26- CXX : ${{ matrix.cxx }}
27- CMAKE_CONFIG : >
28- -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
29- -DLIBINTX_MAX_L=2
30- -DLIBINTX_SIMD=OFF
3136
3237 steps :
33- - uses : actions/checkout@v3
3438
35- - name : " Configure: ${{ env.CMAKE_CONFIG }}"
39+ - uses : actions/checkout@v4
40+
41+ - name : Setup Cache
42+ uses : actions/cache@v4
43+ with :
44+ path : |
45+ ~/.ccache
46+ key : ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.simd }}-${{ hashFiles('**/CMakeLists.txt') }}
47+ restore-keys : |
48+ ${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.simd }}
49+
50+ - name : Setup Cpp Build Tools
51+ uses : aminya/setup-cpp@v1
52+ with :
53+ compiler : ${{ matrix.compiler }}
54+ cmake : true
55+ ninja : true
56+ ccache : true
57+
58+ - name : Install Build Dependencies
3659 run : |
3760 set -x;
38- cmake -B${{github.workspace}}/build $CMAKE_CONFIG
61+ sudo apt-get update && sudo apt-get install -y \
62+ libopenblas-dev \
63+ liblapacke-dev
64+
65+ - name : Set up ccache environment
66+ run : |
67+ echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
68+ echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
69+
70+ - name : ccache stats
71+ run : |
72+ ccache --zero-stats && ccache --show-stats
73+
74+ - name : Configure
75+ run : |
76+ set -x;
77+ cmake -S . -B ./build -G "Ninja Multi-Config" \
78+ -DLIBINTX_MAX_L=2 \
79+ -DLIBINTX_SIMD=${{matrix.simd}} \
80+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
81+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
82+ -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}}
83+
3984
4085 - name : Build
4186 working-directory : ${{github.workspace}}/build
4287 run : |
43- cmake --build . --target all all.tests
88+ cmake --build . --target all all.tests --config ${{matrix.build_type}}
89+
90+ - name : Show ccache stats (after build)
91+ run : ccache -s
4492
4593 - name : Test
4694 working-directory : ${{github.workspace}}/build
0 commit comments