44 branches : [ develop ]
55 pull_request :
66 branches : [ develop ]
7+ paths :
8+ - .github/workflows/cmake.yml
9+ - .gitmodules
10+ - ' **/CMakeLists.txt'
11+ - ' **/*.cmake'
12+ - ' **/*.in'
13+ - ' **/*.h'
14+ - ' **/*.c'
15+ - ' **/*.cc'
16+ - ' **/*.cpp'
17+ - ' **/*.f'
718jobs :
819 build :
920 # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
1829 no_mpi : [OFF, ON]
1930 cxx_standard : [11, 20]
2031 metis : [OFF, ON]
32+ exclude :
33+ - compiler : { name: LLVM }
34+ build_type : Release
35+ - cxx_standard : 20
36+ build_type : Release
37+ env :
38+ CCACHE_DIR : ${{github.workspace}}/.ccache
39+ CCACHE_BASEDIR : ${{github.workspace}}
40+ CCACHE_COMPRESS : true
41+ CCACHE_MAXSIZE : 100M
42+ CMAKE_C_COMPILER_LAUNCHER : ccache
43+ CMAKE_CXX_COMPILER_LAUNCHER : ccache
2144
2245 steps :
2346 - uses : actions/checkout@v4
3255 if : matrix.metis == 'ON'
3356 run : sudo apt install libmetis-dev
3457
58+ - name : setup ccache
59+ id : setup-ccache
60+ run : |
61+ sudo apt-get install ccache
62+ ccache -p # Print ccache config
63+ echo timestamp=$(date -u '+%Y-%m-%dT%T') >> "$GITHUB_OUTPUT"
64+
65+ - name : ccache
66+ uses : actions/cache@v4
67+ with :
68+ path : ${{github.workspace}}/.ccache
69+ key : " ${{matrix.compiler.name}}-\
70+ cxx:${{matrix.cxx_standard}}-\
71+ ${{matrix.build_type}}-\
72+ nompi:${{matrix.no_mpi}}-\
73+ ccache-${{steps.setup-ccache.outputs.timestamp}}"
74+ restore-keys : " ${{matrix.compiler.name}}-\
75+ cxx:${{matrix.cxx_standard}}-\
76+ ${{matrix.build_type}}-\
77+ nompi:${{matrix.no_mpi}}-\
78+ ccache-"
79+
80+ - name : Clear ccache statistics
81+ run : ccache -z
82+
3583 - name : Configure CMake
3684 env :
3785 MPICH_CXX : ${{matrix.compiler.CXX}}
@@ -53,23 +101,26 @@ jobs:
53101 env :
54102 MPICH_CXX : ${{matrix.compiler.CXX}}
55103 MPICH_CC : ${{matrix.compiler.CC}}
56- run : cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j -- target install
104+ run : cmake --build ${{github.workspace}}/build --target install
57105
58106 - name : Test
59107 env :
60108 MPICH_CXX : ${{matrix.compiler.CXX}}
61109 MPICH_CC : ${{matrix.compiler.CC}}
62110 working-directory : ${{github.workspace}}/build
63- run : ctest --output-on-failure -C ${{matrix.build_type}}
111+ run : ctest --output-on-failure
64112
65113 - name : Build User Project
66114 # only need to test with a single build config if the installed cmake config files work
67115 if : matrix.compiler.name == 'GNU' && matrix.build_type == 'Release'
68116 env :
69117 MPICH_CXX : ${{matrix.compiler.CXX}}
70118 MPICH_CC : ${{matrix.compiler.CC}}
71- run : |
72- cmake -S ${{github.workspace}}/doc -B ${{github.workspace}}/buildExample -DCMAKE_CXX_COMPILER=mpicxx -DSCOREC_PREFIX=${{github.workspace}}/build/install
119+ run : >
120+ cmake
121+ -S ${{github.workspace}}/doc -B ${{github.workspace}}/buildExample
122+ -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx
123+ -DSCOREC_PREFIX=${{github.workspace}}/build/install ;
73124 cmake --build ${{github.workspace}}/buildExample
74125
75126 - name : Build MPI-NoMPI Example
@@ -81,10 +132,17 @@ jobs:
81132 MPICH_CXX : ${{matrix.compiler.CXX}}
82133 MPICH_CC : ${{matrix.compiler.CC}}
83134 run : >
84- cmake -S ${{github.workspace}}/example/mpi-nompi
135+ cmake
136+ -S ${{github.workspace}}/example/mpi-nompi
85137 -B ${{github.workspace}}/example/mpi-nompi/build
86- -DCMAKE_CXX_COMPILER=mpicxx
138+ -DCMAKE_C_COMPILER=mpicxx - DCMAKE_CXX_COMPILER=mpicxx
87139 -DSCOREC_PREFIX=${{github.workspace}}/build/install ;
88140 cmake --build ${{github.workspace}}/example/mpi-nompi/build ;
89141 ctest --test-dir ${{github.workspace}}/example/mpi-nompi/build
90142 --output-on-failure
143+
144+ - name : CCache statistics and recompression
145+ run : |
146+ ccache -sv
147+ ccache -X 5
148+
0 commit comments