macOS System CI #2547
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
# Runs the installation tests in the following cases: | |
# 1) every day at 3 am | |
# 2) a pull request to the master branch | |
name: macOS System CI | |
on: | |
schedule: | |
# Every day at 3 am | |
- cron: '0 3 * * *' | |
pull_request: | |
# Upon pull requests | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [macos-12, macos-13, macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Make sure Xcode 14.2 is used on macOS 12 as the default /Application/Xcode.app | |
shell: zsh {0} | |
run: | | |
sudo mv /Applications/Xcode.app /Applications/Xcode.app- | |
sudo ln -s /Applications/Xcode_14.2.app /Applications/Xcode.app | |
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | |
if: matrix.os == 'macos-12' | |
- name: Make sure Xcode 15.2 is used on macOS 13 as the default /Application/Xcode.app | |
shell: bash | |
run: | | |
sudo mv /Applications/Xcode.app /Applications/Xcode.app- | |
sudo ln -s /Applications/Xcode_15.2.app /Applications/Xcode.app | |
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | |
if: matrix.os == 'macos-13' | |
- name: Set GHA_BRANCH_NAME | |
run: | | |
if [ "${{ github.event_name }}" = "push" ]; then | |
echo "GHA_BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
fi | |
if [ "${{ github.event_name }}" = "pull_request" ]; then | |
echo "GHA_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV | |
fi | |
if [ "${{ github.event_name }}" = "schedule" ]; then | |
echo "GHA_BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | |
fi | |
echo "GHA_REPOSITORY=${{ github.repository}}" >> $GITHUB_ENV | |
- name: Install BioDynaMo | |
shell: zsh {0} | |
run: | | |
brew install curl | |
curl https://raw.githubusercontent.com/${GHA_REPOSITORY}/${GHA_BRANCH_NAME}/util/install | bash | |
# remove whole bidynamo repository to catch errors related to paths pointing into the build dir | |
mktemp -d | |
find /tmp -iname biodynamo -type d || true | |
rm -rf $(find $(mktemp -d)/../* -maxdepth 1 -iname biodynamo -type d 2>/dev/null) | |
echo "Removed" | |
find /tmp -iname biodynamo -type d || true | |
- name: Checkout BioDynaMo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set INSTALL_DIR | |
run: | | |
if [ "${{ github.event_name }}" = "push" ]; then | |
echo "INSTALL_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV | |
fi | |
if [ "${{ github.event_name }}" = "pull_request" ]; then | |
echo "INSTALL_DIR=${GITHUB_WORKSPACE}/build" >> $GITHUB_ENV | |
fi | |
if [ "${{ github.event_name }}" = "schedule" ]; then | |
echo "INSTALL_DIR=$(echo ${HOME}/biodynamo-*)" >> $GITHUB_ENV | |
fi | |
# - name: Cache Third Party Packages | |
# uses: actions/cache@v4 | |
# with: | |
# path: build/third_party | |
# key: ${{ runner.os }}-third-party-${{ hashFiles('cmake/external/SHA256Digests.cmake') }} | |
- name: Build BioDynaMo | |
shell: zsh {0} | |
run: | | |
cmake \ | |
-Dopencl=OFF \ | |
-Dparaview=ON \ | |
-Dbenchmark=ON \ | |
-Dlibgit2=ON \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-B build | |
cmake --build build --parallel --config Release | |
# Don't do this in the `Build BioDynaMo step`, because notebooks might time out in GHA | |
# runners, while waiting for other targets to be compiled. Run notebooks only on | |
# macOS 10.15 until we managed to compile ROOT for 11.6 again. | |
- name: Run notebooks | |
shell: zsh {0} | |
run: | | |
cmake \ | |
-Dnotebooks=ON \ | |
-B build | |
cmake --build build --parallel --config Release --target notebooks -- -j1 | |
if: matrix.os == 'macos-10.15' | |
- name: System tests BioDynaMo | |
shell: zsh {0} | |
working-directory: build | |
run: | | |
source $(find /Users -path "*/bin/*" -name "*thisbdm.sh") | |
root --version | |
root -config | |
git config --system user.name "Test User" | |
git config --system user.email [email protected] | |
make run-demos |