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,92 @@ 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+ - ubuntu-24.04-arm
22+
23+ compiler :
24+ - clang
25+ - gcc
26+
27+ build_type :
28+ # - Debug
29+ - Release
2230
23- name : " ${{ matrix.os }}: ${{ matrix.cxx }} ${{ matrix.build_type }}"
31+ simd :
32+ - ON
33+ - OFF
34+
35+ name : " ${{ matrix.os }}: ${{ matrix.compiler }} ${{ matrix.build_type }} ${{matrix.simd == 'ON' && '(simd)' || ''}}"
2436 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
3137
3238 steps :
33- - uses : actions/checkout@v3
3439
35- - name : " Configure: ${{ env.CMAKE_CONFIG }}"
40+ - uses : actions/checkout@v4
41+
42+ - name : Setup Cache
43+ uses : actions/cache@v4
44+ with :
45+ path : |
46+ ~/.ccache
47+ key : ${{ runner.os }}-${{ runner.arch }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.simd }}-${{ hashFiles('**/CMakeLists.txt') }}
48+ restore-keys : |
49+ ${{ runner.os }}-${{ runner.arch }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ matrix.simd }}
50+
51+ - name : Set compiler
52+ run : |
53+ if [[ "${{ matrix.compiler }}" == "gcc" ]]; then
54+ echo "CC=gcc" >> $GITHUB_ENV
55+ echo "CXX=g++" >> $GITHUB_ENV
56+ elif [[ "${{ matrix.compiler }}" == "clang" ]]; then
57+ echo "CC=clang" >> $GITHUB_ENV
58+ echo "CXX=clang++" >> $GITHUB_ENV
59+ else
60+ echo "Unsupported compiler: ${{ matrix.compiler }}"
61+ exit 1
62+ fi
63+
64+ - name : Verify compiler
65+ run : |
66+ set -x;
67+ $CC --version
68+ $CXX --version
69+
70+ - name : Install Build Dependencies
3671 run : |
3772 set -x;
38- cmake -B${{github.workspace}}/build $CMAKE_CONFIG
73+ sudo apt-get update && sudo apt-get install -y \
74+ ccache \
75+ libopenblas-dev \
76+ liblapacke-dev
77+
78+ - name : Set up ccache environment
79+ run : |
80+ echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV
81+ echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
82+
83+ - name : ccache stats
84+ run : |
85+ ccache --zero-stats && ccache --show-stats
86+
87+ - name : Configure
88+ run : |
89+ set -x;
90+ cmake -S . -B ./build -G "Ninja Multi-Config" \
91+ -DLIBINTX_MAX_L=2 \
92+ -DLIBINTX_SIMD=${{matrix.simd}} \
93+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
94+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
95+ -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}}
96+
3997
4098 - name : Build
4199 working-directory : ${{github.workspace}}/build
42100 run : |
43- cmake --build . --target all all.tests
101+ cmake --build . --target all all.tests --config ${{matrix.build_type}}
102+
103+ - name : Show ccache stats (after build)
104+ run : ccache -s
44105
45106 - name : Test
46107 working-directory : ${{github.workspace}}/build
0 commit comments