1- # Copyright (c) 2010-2021 , Lawrence Livermore National Security, LLC. Produced
1+ # Copyright (c) 2010-2022 , Lawrence Livermore National Security, LLC. Produced
22# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
33# LICENSE and NOTICE for details. LLNL-CODE-443271.
44#
1818 branches :
1919 - master
2020 pull_request :
21+ workflow_dispatch :
2122
2223env :
2324 HYPRE_ARCHIVE : v2.19.0.tar.gz
3132 builds-and-tests :
3233 strategy :
3334 matrix :
34- os : [ubuntu-20.04, macos-10.15]
35+ os : [ubuntu-20.04, macos-10.15, windows-2022 ]
3536 target : [dbg, opt]
3637 mpi : [seq]
3738 build-system : [cmake]
@@ -58,18 +59,18 @@ jobs:
5859
5960 steps :
6061 - name : get MPI (Linux)
61- if : matrix.os == 'ubuntu-20.04'
62+ if : matrix.os == 'ubuntu-20.04' && matrix.mpi == 'par'
6263 run : |
6364 sudo apt-get update
6465 sudo apt-get install mpich libmpich-dev
6566 export MAKE_CXX_FLAG="MPICXX=mpic++"
6667
6768 - name : Set up Homebrew
68- if : matrix.os == 'macos-10.15'
69+ if : matrix.os == 'macos-10.15' && matrix.mpi == 'par'
6970 uses : Homebrew/actions/setup-homebrew@master
7071
7172 - name : get MPI (MacOS)
72- if : matrix.os == 'macos-10.15'
73+ if : matrix.os == 'macos-10.15' && matrix.mpi == 'par'
7374 run : |
7475 export HOMEBREW_NO_INSTALL_CLEANUP=1
7576 brew install openmpi
@@ -78,38 +79,42 @@ jobs:
7879 # Get Hypre through cache, or build it.
7980 # Install will only run on cache miss.
8081 - name : cache hypre
82+ if : matrix.mpi == 'par'
8183 id : hypre-cache
8284 uses : actions/cache@v2
8385 with :
8486 path : ${{ env.HYPRE_TOP_DIR }}
85- key : ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-v2
87+ key : ${{ runner.os }}-build-${{ env.HYPRE_TOP_DIR }}-v2.2
8688
8789 - name : build hypre
88- if : steps.hypre-cache.outputs.cache-hit != 'true'
89- uses : mfem/github-actions/build-hypre@v2.0
90+ if : steps.hypre-cache.outputs.cache-hit != 'true' && matrix.mpi == 'par'
91+ uses : mfem/github-actions/build-hypre@v2.2
9092 with :
9193 archive : ${{ env.HYPRE_ARCHIVE }}
9294 dir : ${{ env.HYPRE_TOP_DIR }}
95+ build-system : make
9396
9497 # Get Metis through cache, or build it.
9598 # Install will only run on cache miss.
9699 - name : cache metis
100+ if : matrix.mpi == 'par'
97101 id : metis-cache
98102 uses : actions/cache@v2
99103 with :
100104 path : ${{ env.METIS_TOP_DIR }}
101- key : ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2
105+ key : ${{ runner.os }}-build-${{ env.METIS_TOP_DIR }}-v2.2
102106
103107 - name : build metis
104- if : steps.metis-cache.outputs.cache-hit != 'true'
105- uses : mfem/github-actions/build-metis@v2.0
108+ if : steps.metis-cache.outputs.cache-hit != 'true' && matrix.mpi == 'par'
109+ uses : mfem/github-actions/build-metis@v2.2
106110 with :
107111 archive : ${{ env.METIS_ARCHIVE }}
108112 dir : ${{ env.METIS_TOP_DIR }}
109113
110114 # make generic links to libraries for MFEM install
111115 # Those links are already created by build-mfem action, but not when the cache is used...
112116 - name : configure links
117+ if : matrix.mpi == 'par'
113118 run : |
114119 echo "Hypre symlink:"
115120 ln -s $HYPRE_TOP_DIR hypre;
@@ -127,7 +132,7 @@ jobs:
127132 uses : actions/cache@v2
128133 with :
129134 path : ${{ env.MFEM_TOP_DIR }}
130- key : ${{ runner.os }}-build-${{ env.MFEM_TOP_DIR }}-${{ env.MFEM_COMMIT }}-${{ matrix.target }}-${{ matrix.build-system}}-v1
135+ key : ${{ runner.os }}-build-${{ env.MFEM_TOP_DIR }}-${{ env.MFEM_COMMIT }}-${{ matrix.target }}-${{ matrix.build-system}}-v2.2
131136
132137 # We are using the defaults of the MFEM action here, which is to use master
133138 # branch. There is an implicit assumption here that mfem master hasn't
@@ -136,7 +141,7 @@ jobs:
136141 # superfluous.
137142 - name : build mfem
138143 if : steps.cache-mfem.outputs.cache-hit != 'true'
139- uses : mfem/github-actions/build-mfem@v2.0
144+ uses : mfem/github-actions/build-mfem@v2.2
140145 with :
141146 os : ${{ matrix.os }}
142147 target : ${{ matrix.target }}
@@ -167,6 +172,18 @@ jobs:
167172 export HOMEBREW_NO_INSTALL_CLEANUP=1
168173 brew install fontconfig freetype sdl2 glew glm libpng
169174
175+ - name : cache deps (Windows)
176+ id : cache-deps
177+ uses : actions/cache@v3
178+ with :
179+ path : vcpkg_cache
180+ key : ${{ runner.os }}-vcpkg-v1
181+
182+ - name : prepare binary cache location
183+ if : steps.cache-deps.outputs.cache-hit != 'true'
184+ run : |
185+ mkdir -p vcpkg_cache
186+
170187 - name : checkout GLVis
171188 uses : actions/checkout@v2
172189 with :
@@ -182,17 +199,23 @@ jobs:
182199
183200 - name : build GLVis (cmake)
184201 if : matrix.build-system == 'cmake'
202+ env :
203+ VCPKG_DEFAULT_BINARY_CACHE : ${{ github.workspace }}/vcpkg_cache
185204 run : |
186- build_type="RelWithDebInfo "
205+ build_type="Release "
187206 [[ ${{ matrix.target }} == "dbg" ]] && build_type="Debug";
207+ [[ ${{ matrix.os }} == "windows-2022" ]] \
208+ && toolchain_file="${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake"
188209 cd glvis && mkdir build && cd build
189210 cmake \
211+ -D CMAKE_TOOLCHAIN_FILE:STRING=${toolchain_file} \
190212 -D CMAKE_BUILD_TYPE:STRING=${build_type} \
191213 -D ENABLE_TESTS:BOOL=TRUE \
192214 -D mfem_DIR:PATH=${GITHUB_WORKSPACE}/${MFEM_TOP_DIR}/build \
193215 -D GLVIS_BASELINE_SYS=${{ matrix.os }} \
194216 ..
195- make -j3
217+ cmake --build . --parallel 3 --config "${build_type}"
218+ shell : bash
196219
197220 - name : setup Python
198221 if : matrix.build-system == 'cmake'
@@ -223,10 +246,15 @@ jobs:
223246 run : |
224247 cd glvis && cd build
225248 ctest --verbose
249+
250+ - name : create screenshot tarball
251+ if : always() && matrix.build-system == 'cmake' && matrix.os != 'windows-2022'
252+ run : |
253+ cd glvis && cd build
226254 tar czvf test_screenshots.tar.gz tests/test.*.png
227255
228256 - name : upload test screenshots
229- if : matrix.build-system == 'cmake'
257+ if : always() && matrix.build-system == 'cmake' && matrix.os != 'windows-2022 '
230258 uses : actions/upload-artifact@v2
231259 with :
232260 name : test-screenshots-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.mpi }}
0 commit comments