From 54399dbdddaa6b44dbbcdbc759a9d98e97a48be0 Mon Sep 17 00:00:00 2001 From: Smit1603 Date: Sat, 30 Sep 2023 15:40:18 +0530 Subject: [PATCH] Updating CI with macos build --- .github/workflows/ci.yml | 66 +++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6158fa60c..3be6ce8e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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" \ @@ -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 ../../ @@ -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 ..