fixed upload paths #176
This file contains hidden or 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: [push, workflow_dispatch] | |
| jobs: | |
| native-build: | |
| name: | |
| native-build-${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [windows-latest, ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest] | |
| #platform: [windows-latest, windows-11-arm, ubuntu-latest, ubuntu-24.04-arm, macos-15-intel, macos-latest] | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: checkout vcell-ode repo | |
| uses: actions/checkout@v4 | |
| - name: Install Windows Dependencies (Part 0 - Setup LLVM-style) | |
| if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm' | |
| uses: llvm/actions/setup-windows@main | |
| with: | |
| arch: amd64 | |
| - name: Install Windows Dependencies (Part 1 - Configure Conan ...and zip) | |
| if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm' | |
| shell: powershell | |
| run: | | |
| choco install zip -y | |
| choco install conan -y | |
| $conanDir = "C:\Program Files\Conan\conan" | |
| $env:PATH = "$conanDir;$env:PATH" | |
| $conanDir | Set-Content -Path $env:GITHUB_PATH | |
| $env:CONAN_HOME = "C:\.conan" | |
| "CONAN_HOME=C:\.conan" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| conan --version | |
| conan profile detect --force | |
| - name: Install Windows Dependencies (Part 2 - Reconfigure Conan) <x86_64> | |
| if: matrix.platform == 'windows-latest' | |
| shell: bash | |
| run: | | |
| cp conan-profiles/CI-CD/Windows-AMD64_profile.txt $CONAN_HOME/profiles/default | |
| - name: Install Windows Dependencies (Part 2 - Reconfigure Conan) <ARM> | |
| if: matrix.platform == 'windows-11-arm' | |
| shell: bash | |
| run: | | |
| cp conan-profiles/CI-CD/Windows-ARM64_profile.txt $CONAN_HOME/profiles/default | |
| - name: Install MacOS dependencies <x86_64> | |
| if: matrix.platform == 'macos-15-intel' | |
| shell: bash | |
| run: | | |
| brew install conan | |
| conan --version | |
| mkdir -p ~/.conan2/profiles/ | |
| touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist | |
| cp conan-profiles/CI-CD/MacOS-AMD64_profile.txt ~/.conan2/profiles/default | |
| - name: Install MacOS dependencies <ARM> | |
| if: matrix.platform == 'macos-latest' | |
| shell: bash | |
| run: | | |
| brew install conan | |
| conan --version | |
| mkdir -p ~/.conan2/profiles/ | |
| touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist | |
| cp conan-profiles/CI-CD/MacOS-ARM64_profile.txt ~/.conan2/profiles/default | |
| - name: Install Linux Dependencies <x86_64> | |
| if: matrix.platform == 'ubuntu-latest' | |
| run: | | |
| sudo apt update | |
| sudo apt upgrade -y | |
| sudo apt install -y wget | |
| wget --version | |
| wget https://github.com/conan-io/conan/releases/download/2.22.2/conan-2.22.2-amd64.deb | |
| sudo apt install -y ./conan-*.deb | |
| conan --version | |
| mkdir -p ~/.conan2/profiles/ | |
| touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist | |
| cp conan-profiles/CI-CD/Linux-AMD64_profile.txt ~/.conan2/profiles/default | |
| - name: Install Linux Dependencies <ARM> | |
| if: matrix.platform == 'ubuntu-24.04-arm' | |
| run: | | |
| sudo apt update | |
| python3 -m pip install conan | |
| conan --version | |
| mkdir -p ~/.conan2/profiles/ | |
| touch ~/.conan2/profiles/default # if we don't make a file first, cp thinks its a folder that doesn't exist | |
| cp conan-profiles/CI-CD/Linux-ARM64_profile.txt ~/.conan2/profiles/default | |
| - name: Install Dependencies through Conan on Windows | |
| if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm' | |
| shell: powershell | |
| run: | | |
| conan install . --output-folder build --build=missing -o include_messaging=False | |
| - name: Install Dependencies through Conan on MacOS | |
| if: matrix.platform == 'macos-latest' || matrix.platform == 'macos-15-intel' | |
| shell: bash | |
| run: | | |
| conan install . --output-folder build --build=missing | |
| - name: Install Dependencies through Conan on Linux <x86_64> | |
| if: matrix.platform == 'ubuntu-latest' | |
| shell: bash | |
| run: | | |
| sudo apt --purge remove gcc | |
| sudo ln -s /usr/bin/clang /usr/bin/cc | |
| sudo apt install mold libc++-dev libc++abi-dev | |
| sudo rm /usr/bin/ld | |
| sudo ln -s $(which mold) /usr/bin/ld | |
| conan install -v trace . --output-folder build --build=missing | |
| - name: Install Dependencies through Conan on Linux <ARM> | |
| if: matrix.platform == 'ubuntu-24.04-arm' | |
| shell: bash | |
| run: | | |
| sudo apt --purge remove gcc | |
| sudo ln -s /usr/bin/clang /usr/bin/cc | |
| sudo ln -s /usr/bin/clang /usr/bin/gcc | |
| sudo ln -s /usr/bin/clang++ /usr/bin/g++ | |
| sudo apt install mold libc++-dev libc++abi-dev | |
| sudo rm /usr/bin/ld | |
| sudo ln -s $(which mold) /usr/bin/ld | |
| conan install . --output-folder build --build=missing | |
| - name: Build Windows | |
| if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm' | |
| shell: powershell | |
| run: | | |
| cd build | |
| ./conanbuild.ps1 | |
| cmake -B . -S .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . --config Release | |
| - name: Build Non-Intel-Mac Unix | |
| if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'ubuntu-24.04-arm' || matrix.platform == 'macos-15-intel' || matrix.platform == 'macos-latest' | |
| run: | | |
| echo "working dir is $PWD" | |
| cd build | |
| source conanbuild.sh | |
| cmake -B . -S .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release | |
| cmake --build . --config Release | |
| - name: Test Windows | |
| if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm' | |
| run: | | |
| cd build | |
| ctest -VV | |
| ./bin/SundialsSolverStandalone_x64 || true | |
| - name: Test Unix | |
| if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'ubuntu-24.04-arm' || matrix.platform == 'macos-15-intel' || matrix.platform == 'macos-latest' | |
| run: | | |
| cd build | |
| ctest -VV | |
| echo "------ running SundialsSolverStandalone_x64 ------" | |
| ./bin/SundialsSolverStandalone_x64 || true | |
| - name: fix Macos shared object paths | |
| if: matrix.platform == 'macos-15-intel' || matrix.platform == 'macos-latest' | |
| shell: bash | |
| run: | | |
| mkdir build/upload | |
| cd build/bin | |
| rm hello_test TestVCellStoch testzip ziptool || true | |
| 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/mac64.tgz --dereference . | |
| - name: handle shared object paths for Windows native build | |
| if: matrix.platform == 'windows-latest' || matrix.platform == 'windows-11-arm' | |
| shell: bash | |
| run: | | |
| mkdir build/upload | |
| cd build/bin | |
| rm hello_test* *.pdb || true | |
| ls *.exe | awk '{print $1}' | xargs -I '{}' ldd '{}' | grep '=> /' | grep -v build | grep -iv windows | awk '{print $3}' | xargs -I '{}' cp -vn '{}' . || true | |
| # Currently, Sundials only requires system32 dlls! | |
| # 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/win64.zip ./* | |
| cd ../.. | |
| # fi | |
| - name: handle shared object paths for Linux native build | |
| if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'ubuntu-24.04-arm' | |
| shell: bash | |
| run: | | |
| mkdir build/upload | |
| cd build/bin | |
| rm hello_test TestVCellStoch testzip ziptool || true | |
| 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/linux64.tgz --dereference . | |
| cd ../.. | |
| - name: Upload Intel Macos binaries | |
| if: matrix.platform == 'macos-15-intel' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos_x86_64.tgz | |
| path: build/upload/mac64.tgz | |
| - name: Upload ARM Macos binaries | |
| if: matrix.platform == 'macos-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos_arm64.tgz | |
| path: build/upload/mac64.tgz | |
| - name: Upload Windows (x86_64) binaries | |
| if: matrix.platform == 'windows-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: win64_x86_64.zip | |
| path: build/upload/win64.zip | |
| - name: Upload Windows (ARMv8) binaries | |
| if: matrix.platform == 'windows-11-arm' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: win64_arm64.zip | |
| path: build/upload/win64.zip | |
| - name: Upload Linux (x86_64) binaries | |
| if: matrix.platform == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux64_x86_64.tgz | |
| path: build/upload/linux64.tgz | |
| - name: Upload Linux (ARMv8) binaries | |
| if: matrix.platform == 'ubuntu-24.04-arm' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux64_arm64.tgz | |
| path: build/upload/linux64.tgz | |
| - name: Setup tmate session | |
| if: ${{ failure() }} | |
| uses: mxschmitt/action-tmate@v3 | |
| with: | |
| limit-access-to-actor: false |