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
1627 - { name: LLVM, CC: clang, CXX: clang++ }
1728 build_type : [Debug, Release]
1829 no_mpi : [OFF, ON]
30+ cxx_standard : [11, 20]
31+ 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
1944
2045 steps :
2146 - uses : actions/checkout@v4
@@ -26,34 +51,76 @@ jobs:
2651 run : |
2752 sudo apt update
2853 sudo apt install gcc-10 g++-10 mpich
54+ - name : install metis
55+ if : matrix.metis == 'ON'
56+ run : sudo apt install libmetis-dev
57+
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
2982
3083 - name : Configure CMake
3184 env :
3285 MPICH_CXX : ${{matrix.compiler.CXX}}
3386 MPICH_CC : ${{matrix.compiler.CC}}
34- run : cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_VERBOSE_MAKEFILE=ON -DMESHES=${{github.workspace}}/pumi-meshes -DIS_TESTING=ON -DSCOREC_CXX_WARNINGS=ON -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install -DSCOREC_NO_MPI=${{matrix.no_mpi}}
87+ run : >
88+ cmake -S ${{github.workspace}} -B ${{github.workspace}}/build
89+ -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install
90+ -GNinja -DCMAKE_VERBOSE_MAKEFILE=ON
91+ -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
92+ -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc
93+ -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}}
94+ -DSCOREC_CXX_WARNINGS=ON
95+ -DIS_TESTING=ON
96+ -DMESHES=${{github.workspace}}/pumi-meshes
97+ -DSCOREC_NO_MPI=${{matrix.no_mpi}}
98+ -DENABLE_METIS=${{matrix.metis}}
3599
36100 - name : Build
37101 env :
38102 MPICH_CXX : ${{matrix.compiler.CXX}}
39103 MPICH_CC : ${{matrix.compiler.CC}}
40- run : cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j -- target install
104+ run : cmake --build ${{github.workspace}}/build --target install
41105
42106 - name : Test
43107 env :
44108 MPICH_CXX : ${{matrix.compiler.CXX}}
45109 MPICH_CC : ${{matrix.compiler.CC}}
46110 working-directory : ${{github.workspace}}/build
47- run : ctest --output-on-failure -C ${{matrix.build_type}}
111+ run : ctest --output-on-failure
48112
49113 - name : Build User Project
50114 # only need to test with a single build config if the installed cmake config files work
51115 if : matrix.compiler.name == 'GNU' && matrix.build_type == 'Release'
52116 env :
53117 MPICH_CXX : ${{matrix.compiler.CXX}}
54118 MPICH_CC : ${{matrix.compiler.CC}}
55- run : |
56- 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 ;
57124 cmake --build ${{github.workspace}}/buildExample
58125
59126 - name : Build MPI-NoMPI Example
@@ -65,10 +132,17 @@ jobs:
65132 MPICH_CXX : ${{matrix.compiler.CXX}}
66133 MPICH_CC : ${{matrix.compiler.CC}}
67134 run : >
68- cmake -S ${{github.workspace}}/example/mpi-nompi
135+ cmake
136+ -S ${{github.workspace}}/example/mpi-nompi
69137 -B ${{github.workspace}}/example/mpi-nompi/build
70- -DCMAKE_CXX_COMPILER=mpicxx
138+ -DCMAKE_C_COMPILER=mpicxx - DCMAKE_CXX_COMPILER=mpicxx
71139 -DSCOREC_PREFIX=${{github.workspace}}/build/install ;
72140 cmake --build ${{github.workspace}}/example/mpi-nompi/build ;
73141 ctest --test-dir ${{github.workspace}}/example/mpi-nompi/build
74142 --output-on-failure
143+
144+ - name : CCache statistics and recompression
145+ run : |
146+ ccache -sv
147+ ccache -X 5
148+
0 commit comments