Skip to content

Commit

Permalink
Updating CI with macos build
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit1603 committed Oct 1, 2023
1 parent ddd0f95 commit 54399db
Showing 1 changed file with 35 additions and 31 deletions.
66 changes: 35 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
# cppyy: Off
# extra_cmake_options: '-DLLVM_USE_LINKER=lld'

# - name: ubu22-gcc9-clang-repl-16
# os: ubuntu-22.04
# compiler: gcc-9
# clang-runtime: '16'
# cling: Off
# cppyy: Off
# coverage: true
# extra_cmake_options: '-DLLVM_USE_LINKER=lld'
- name: ubu22-gcc9-clang-repl-16
os: ubuntu-22.04
compiler: gcc-9
clang-runtime: '16'
cling: Off
cppyy: Off
coverage: true
extra_cmake_options: '-DLLVM_USE_LINKER=lld'

# - name: ubu22-gcc9-clang13-cling
# os: ubuntu-22.04
Expand Down Expand Up @@ -93,8 +93,10 @@ jobs:
run: |
echo "BUILD_TYPE=Release" >> $GITHUB_ENV
echo "CODE_COVERAGE=0" >> $GITHUB_ENV
if [[ "${os}" == "macos*" ]]; then
echo "ncpus=$(sysctl -n hw.physicalcpu)" >> $GITHUB_ENV
os="${{ matrix.os }}"
echo "$os"
if [[ "${os}" == "macos"* ]]; then
echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
else
echo "ncpus=$(nproc --all)" >> $GITHUB_ENV
fi
Expand Down Expand Up @@ -169,6 +171,7 @@ jobs:
- name: Build LLVM/Cling on Unix if the cache is invalid
if: ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }}
run: |
os="${{ matrix.os }}"
cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]')
if [[ "${cling_on}" == "ON" ]]; then
git clone --depth=1 https://github.com/root-project/cling.git
Expand All @@ -177,20 +180,11 @@ jobs:
git clone --depth=1 -b release/${{ matrix.clang-runtime }}.x https://github.com/llvm/llvm-project.git
fi
cd llvm-project
# # Apply patches
# echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
# # Finding patch and applying it
# patch_dir="../patches/llvm"
# patch_pattern="clang${{ matrix.clang-runtime }}-*.patch"
# find "$patch_dir" -name "$patch_pattern" -print | while read -r patch_file; do
# echo "Applying patch: $patch_file"
# git apply "$patch_file"
# done
# Apply patches
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
# echo "Apply clang-*.patch patches:"
compgen -G "../patches/llvm/clang-*.patch" > /dev/null && find ../patches/llvm -name "clang-*.patch" -exec basename {} \; -print -exec git apply {} \;
compgen -G "../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch" > /dev/null && find ../patches/llvm/clang${{ matrix.clang-runtime }}-*.patch -exec basename {} \; -print -exec git apply {} \;
# Build
mkdir build
cd build
Expand All @@ -206,14 +200,17 @@ jobs:
-DCLANG_ENABLE_FORMAT=OFF \
-DCLANG_ENABLE_BOOTSTRAP=OFF \
../llvm
# cmake --build . --target clang --parallel $(sysctl -n hw.physicalcpu)
# cmake --build . --target cling --parallel $(sysctl -n hw.physicalcpu)
# # Now build gtest.a and gtest_main for CppInterOp to run its tests.
# cmake --build . --target gtest_main --parallel $(sysctl -n hw.physicalcpu)
cmake --build . --target clang --parallel $(sysctl -n hw.physicalcpu)
cmake --build . --target cling --parallel $(sysctl -n hw.physicalcpu)
# if [[ "${os}" == "macos*" ]]; then
# cmake --build . --target clang --parallel $(sysctl -n hw.ncpu)
# cmake --build . --target cling --parallel $(sysctl -n hw.ncpu)
# # Now build gtest.a and gtest_main for CppInterOp to run its tests.
# cmake --build . --target gtest_main --parallel $(sysctl -n hw.ncpu)
# else
cmake --build . --target clang --parallel ${{ env.ncpus }}
cmake --build . --target cling --parallel ${{ env.ncpus }}
# Now build gtest.a and gtest_main for CppInterOp to run its tests.
cmake --build . --target gtest_main --parallel $(sysctl -n hw.physicalcpu)
cmake --build . --target gtest_main --parallel ${{ env.ncpus }}
# fi
else
cmake -DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_TARGETS_TO_BUILD="host;NVPTX" \
Expand All @@ -224,8 +221,11 @@ jobs:
-DCLANG_ENABLE_FORMAT=OFF \
-DCLANG_ENABLE_BOOTSTRAP=OFF \
../llvm
# cmake --build . --target clang clang-repl --parallel $(sysctl -n hw.physicalcpu)
# if [[ "${os}" == "macos*" ]]; then
# cmake --build . --target clang clang-repl --parallel $(sysctl -n hw.ncpu)
# else
cmake --build . --target clang clang-repl --parallel ${{ env.ncpus }}
# fi
fi
cd ../../
Expand Down Expand Up @@ -287,9 +287,13 @@ jobs:
../
fi
os="${{ matrix.os }}"
# if [[ "${os}" == "macos*" ]]; then
# cmake --build . --target check-cppinterop --parallel $(sysctl -n hw.ncpu)
# else
cmake --build . --target check-cppinterop --parallel ${{ env.ncpus }}
# fi
cppyy_on=$(echo "${{ matrix.cppyy }}" | tr '[:lower:]' '[:upper:]')
if [[ ("${cppyy_on}" != "ON") && ("${os}" = "ubuntu*") ]]; then
if [[ ("${cppyy_on}" != "ON") && ("${os}" = "ubuntu"*) ]]; then
valgrind --track-origins=yes --error-exitcode=1 unittests/CppInterOp/CppInterOpTests 2>&1 >/dev/null
fi
cd ..
Expand Down

0 comments on commit 54399db

Please sign in to comment.