smoke test for FiniteVolume and Smoldyn #115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
native-build: | |
name: | |
native-build-${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [macos-13, windows-latest, ubuntu-latest, macos-14] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: checkout vcell-solvers repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Intel MacOS dependencies | |
if: matrix.platform == 'macos-13' | |
shell: bash | |
run: | | |
brew install boost | |
brew install hdf5 | |
brew install libzip | |
brew install ninja | |
brew install llvm | |
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile | |
source /Users/runner/.bash_profile | |
ln -s $(which gfortran-14) /usr/local/bin/gfortran | |
gcc --version | |
gfortran --version | |
cmake --version | |
brew info boost | |
brew info hdf5 | |
- name: Install ARM MacOS dependencies | |
if: matrix.platform == 'macos-14' | |
shell: bash | |
run: | | |
brew install boost | |
brew install hdf5 | |
brew install libzip | |
brew install ninja | |
brew install llvm | |
echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> /Users/runner/.bash_profile | |
ln -s /opt/homebrew/bin/gfortran-14 /usr/local/bin/gfortran | |
gcc --version | |
gfortran --version | |
cmake --version | |
brew info boost | |
brew info hdf5 | |
- name: Build Macos ARM | |
if: matrix.platform == 'macos-14' | |
run: | | |
platform=macos | |
echo "working dir is $PWD" | |
mkdir build | |
cd build | |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH" | |
cmake \ | |
-G Ninja \ | |
-DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang \ | |
-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ \ | |
-DOPTION_TARGET_PYTHON_BINDING=OFF \ | |
-DOPTION_MINGW=ON \ | |
-DOPTION_TARGET_MESSAGING=OFF \ | |
-DOPTION_TARGET_SMOLDYN_SOLVER=OFF \ | |
-DOPTION_TARGET_FV_SOLVER=ON \ | |
-DOPTION_TARGET_DOCS=ON \ | |
-B . -S .. | |
ninja | |
- name: Build Macos Intel | |
if: matrix.platform == 'macos-13' | |
run: | | |
platform=macos | |
echo "working dir is $PWD" | |
mkdir build | |
cd build | |
export PATH="/usr/local/opt/llvm/bin:$PATH" | |
cmake \ | |
-G Ninja \ | |
-DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \ | |
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ \ | |
-DOPTION_TARGET_PYTHON_BINDING=OFF \ | |
-DOPTION_MINGW=ON \ | |
-DOPTION_TARGET_MESSAGING=OFF \ | |
-DOPTION_TARGET_SMOLDYN_SOLVER=OFF \ | |
-DOPTION_TARGET_FV_SOLVER=ON \ | |
-DOPTION_TARGET_DOCS=ON \ | |
-B . -S .. | |
ninja | |
- name: Test Macos | |
if: matrix.platform == 'macos-13' || matrix.platform == 'macos-14' | |
run: | | |
platform=macos | |
echo "working dir is $PWD" | |
cd build | |
ctest -VV | |
echo "------ running FiniteVolume_x64 ------" | |
./bin/FiniteVolume_x64 || true | |
echo | |
echo "------ running NFsim_x64 ------" | |
./bin/NFsim_x64 || true | |
echo "------ running SundialsSolverStandalone_x64 ------" | |
./bin/SundialsSolverStandalone_x64 || true | |
echo "------ running VCellStoch_x64 ------" | |
./bin/VCellStoch_x64 || true | |
echo "------ running smoldyn_x64 ------" | |
./bin/smoldyn_x64 || true | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
# with: | |
# limit-access-to-actor: false | |
- name: Install Windows Dependencies | |
if: matrix.platform == 'windows-latest' | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: CLANG64 | |
update: true | |
install: > | |
zip | |
git | |
mingw-w64-clang-x86_64-curl | |
mingw-w64-clang-x86_64-toolchain | |
mingw-w64-clang-x86_64-flang | |
mingw-w64-clang-x86_64-cmake | |
mingw-w64-clang-x86_64-boost | |
mingw-w64-clang-x86_64-hdf5 | |
mingw-w64-clang-x86_64-libzip | |
mingw-w64-clang-x86_64-zlib | |
mingw-w64-clang-x86_64-libaec | |
# - name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
# with: | |
# limit-access-to-actor: false | |
- name: Build Windows | |
if: matrix.platform == 'windows-latest' | |
shell: msys2 {0} | |
run: | | |
platform=windows | |
echo "working dir is $PWD" | |
mkdir build | |
cd build | |
export PATH="/c/Program\ Files/LLVM/bin:$PATH" | |
cmake \ | |
-G Ninja \ | |
-DCMAKE_C_COMPILER="clang.exe" \ | |
-DCMAKE_CXX_COMPILER="clang++.exe" \ | |
-DOPTION_TARGET_PYTHON_BINDING=OFF \ | |
-DOPTION_TARGET_MESSAGING=OFF \ | |
-DOPTION_TARGET_SMOLDYN_SOLVER=OFF \ | |
-DOPTION_TARGET_FV_SOLVER=ON \ | |
-DOPTION_TARGET_DOCS=OFF \ | |
-B . -S .. | |
ninja -j 1 | |
- name: Test Windows | |
if: matrix.platform == 'windows-latest' | |
shell: msys2 {0} | |
run: | | |
platform=windows | |
echo "working dir is $PWD" | |
cd build | |
export PATH="/d/a/_temp/msys64/clang64/bin:$PATH" | |
pacman -Sy --noconfirm diffutils | |
ctest -VV | |
echo "------ running FiniteVolume_x64 ------" | |
./bin/FiniteVolume_x64 || true | |
echo | |
- name: Install Linux Dependencies | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libboost-all-dev | |
sudo apt-get install -y libhdf5-dev | |
sudo apt-get install -y libzip-dev | |
sudo apt-get install -y ninja-build | |
gcc --version | |
gfortran --version | |
cmake --version | |
dpkg -s libboost-all-dev | |
dpkg -s libhdf5-dev | |
- name: Build Linux | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
platform=linux | |
echo "working dir is $PWD" | |
mkdir build | |
cd build | |
cmake \ | |
-G Ninja \ | |
-DOPTION_TARGET_PYTHON_BINDING=OFF \ | |
-DOPTION_TARGET_MESSAGING=OFF \ | |
-DOPTION_TARGET_SMOLDYN_SOLVER=OFF \ | |
-DOPTION_TARGET_FV_SOLVER=ON \ | |
-DOPTION_TARGET_DOCS=ON \ | |
-B . -S .. | |
ninja | |
- name: Test Linux | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
platform=linux | |
echo "working dir is $PWD" | |
cd build | |
ctest -VV | |
echo "------ running FiniteVolume_x64 ------" | |
./bin/FiniteVolume_x64 || true | |
echo | |
- name: fix Macos shared object paths | |
if: matrix.platform == 'macos-13' || matrix.platform == 'macos-14' | |
shell: bash | |
run: | | |
mkdir build/upload | |
cd build/bin | |
ls *_x64 | awk '{print $1}' | xargs -I '{}' otool -L '{}' | grep ")" | grep -v "build" | grep -v "System" | awk '{print $1}' | xargs -I '{}' cp -vn '{}' . || true | |
ls *.dylib | awk '{print $1}' | xargs -I '{}' otool -L '{}' | grep ")" | grep -v "build" | grep -v "System" | awk '{print $1}' | xargs -I '{}' cp -vn '{}' . || true | |
ls *.dylib | awk '{print $1}' | xargs -I '{}' otool -L '{}' | grep ")" | grep -v "build" | grep -v "System" | awk '{print $1}' | xargs -I '{}' cp -vn '{}' . || true | |
chmod u+w,+x * | |
tar czvf ../upload/mac64_bad_paths.tgz . | |
../../.github/scripts/install_name_tool_macos.sh | |
tar czvf ../upload/fvsolver_mac64.tgz --dereference . | |
- name: handle shared object paths for Windows native build | |
if: matrix.platform == 'windows-latest' | |
shell: msys2 {0} | |
run: | | |
mkdir build/upload | |
cd build/bin | |
ls *.exe | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep '=> /' | grep -v build | grep -iv windows | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true | |
ls *.dll | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep '=> /' | grep -v build | grep -iv windows | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true | |
ls *.dll | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep '=> /' | grep -v build | grep -iv windows | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true | |
chmod u+w,+x * | |
zip ../upload/fvsolver_win64.zip ./* | |
cd ../.. | |
# fi | |
- name: handle shared object paths for Linux native build | |
if: matrix.platform == 'ubuntu-latest' | |
shell: bash | |
run: | | |
mkdir build/upload | |
cd build/bin | |
ls *_x64 | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep "=> /" | grep -v "build" | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true | |
ls *.so | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep "=> /" | grep -v "build" | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true | |
ls *.so | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep "=> /" | grep -v "build" | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true | |
chmod u+w,+x * | |
tar czvf ../upload/fvsolver_linux64.tgz --dereference . | |
cd ../.. | |
- name: Upload Intel Macos binaries | |
if: matrix.platform == 'macos-13' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fvsolver_macos_x86_64.tgz | |
path: build/upload/fvsolver_mac64.tgz | |
- name: Upload ARM Macos binaries | |
if: matrix.platform == 'macos-14' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fvsolver_macos_arm64.tgz | |
path: build/upload/fvsolver_mac64.tgz | |
- name: Upload Windows binaries | |
if: matrix.platform == 'windows-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fvsolver_win64.zip | |
path: build/upload/fvsolver_win64.zip | |
- name: Upload Linux binaries | |
if: matrix.platform == 'ubuntu-latest' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fvsolver_linux64.tgz | |
path: build/upload/fvsolver_linux64.tgz | |
- name: Setup tmate session | |
if: ${{ failure() }} | |
uses: mxschmitt/action-tmate@v3 | |
with: | |
limit-access-to-actor: false | |