diff --git a/.github/actions/Miscellaneous/Install_Dependencies/action.yml b/.github/actions/Miscellaneous/Install_Dependencies/action.yml new file mode 100644 index 000000000..9fe855fa6 --- /dev/null +++ b/.github/actions/Miscellaneous/Install_Dependencies/action.yml @@ -0,0 +1,54 @@ +name: 'Install Dependencies' +description: 'This PR installs the dependencies needed' + +runs: + using: composite + steps: + + - name: Install dependencies on MacOS + if: runner.os == 'macOS' + shell: bash + run: | + brew update --force + if [[ "$(uname -m)" == "x86_64" ]]; then + brew remove swiftlint + else + brew remove unxip + fi + # workaround for https://github.com/actions/setup-python/issues/577 + for pkg in $(brew list | grep '^python@'); do + brew unlink "$pkg" + brew link --overwrite "$pkg" + done + brew upgrade openssl >/dev/null 2>&1 + brew upgrade --force + brew install ninja + brew install eigen + brew install boost + brew install gnu-sed + pip install distro pytest + + - name: Install dependencies on Linux + if: runner.os == 'Linux' + shell: bash + run: | + # Install deps + sudo apt-get update + sudo apt-get install valgrind ninja-build + sudo apt-get install git g++ debhelper devscripts gnupg python3 doxygen graphviz python3-sphinx + sudo apt-get install -y libc6-dbg + sudo apt-get install valgrind + sudo apt autoremove + sudo apt clean + # Install libraries used by the cppyy test suite + sudo apt install libeigen3-dev + sudo apt install libboost-all-dev + + + - name: Install dependencies on Windows + if: runner.os == 'Windows' + shell: powershell + run: | + choco install findutils + $env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH" + diff --git a/.github/actions/Miscellaneous/Save_PR_Info/action.yml b/.github/actions/Miscellaneous/Save_PR_Info/action.yml new file mode 100644 index 000000000..41b61de89 --- /dev/null +++ b/.github/actions/Miscellaneous/Save_PR_Info/action.yml @@ -0,0 +1,57 @@ +name: 'Save PR Info' +description: 'This PR saves the PR Info for the job' + +runs: + using: composite + steps: + + - name: Save PR Info on Unix Systems + if: ${{ runner.os != 'Windows' }} + shell: bash + run: | + mkdir -p ./pr + echo ${{ github.event.number }} > ./pr/NR + echo ${{ github.repository }} > ./pr/REPO + + cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') + if [[ "$cling_on" == "ON" ]]; then + export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') + export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') + else + export CLING_HASH="Repl" + # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x + # which could be quite often for new releases + export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') + fi + + echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV + echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV + + - name: Save PR Info on Windows systems + if: runner.os == 'Windows' + shell: powershell + run: | + #can be found + mkdir ./pr + echo "${{ github.event.number }}" > ./pr/NR + echo ${{ github.repository }} > ./pr/REPO + + if ( "${{ matrix.cling }}" -imatch "On" ) + { + $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) + $env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-" + } + else + { + $env:CLING_HASH="Repl" + # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x + # which could be quite often for new releases + $env:LLVM_HASH_TEMP = (git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x ) + $env:LLVM_HASH = $env:LLVM_HASH_TEMP -replace "\t","-" + } + + echo "CLING_HASH=$env:CLING_HASH" + echo "LLVM_HASH=$env:LLVM_HASH" + + echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV + echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV diff --git a/.github/actions/Miscellaneous/Select_Default_Build_Type/action.yml b/.github/actions/Miscellaneous/Select_Default_Build_Type/action.yml new file mode 100644 index 000000000..63edc4caf --- /dev/null +++ b/.github/actions/Miscellaneous/Select_Default_Build_Type/action.yml @@ -0,0 +1,23 @@ +name: 'Select Default Build Type' +description: 'This action selects the default build typose' + +runs: + using: composite + steps: + - name: Select default build type of Unix Systems + if: runner.os != 'Windows' + shell: bash + run: | + echo "BUILD_TYPE=Release" >> $GITHUB_ENV + echo "CODE_COVERAGE=0" >> $GITHUB_ENV + echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV + + - name: Select default build type on Windows + if: runner.os == 'Windows' + shell: powershell + run: | + echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV + echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV + $env:ncpus=$([Environment]::ProcessorCount) + echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV + diff --git a/.github/actions/Miscellaneous/Setup_Compiler/action.yml b/.github/actions/Miscellaneous/Setup_Compiler/action.yml new file mode 100644 index 000000000..2e8d63abd --- /dev/null +++ b/.github/actions/Miscellaneous/Setup_Compiler/action.yml @@ -0,0 +1,77 @@ +name: 'Setup Compiler' +description: 'This PR sets up the compiler for the job' + +runs: + using: composite + steps: + + - name: Setup Compiler on MacOS + if: runner.os == 'macOS' + shell: bash + run: | + vers="${compiler#*-}" + if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then + brew install "gcc@$vers" + echo "CC=gcc-${vers}" >> $GITHUB_ENV + echo "CXX=g++-${vers}" >> $GITHUB_ENV + else + brew install llvm@15 + if [[ "$(uname -m)" == "x86_64" ]]; then + echo "CC=/usr/local/opt/llvm@15/bin/clang" >> $GITHUB_ENV + echo "CXX=/usr/local/opt/llvm@15/bin/clang++" >> $GITHUB_ENV + else + echo "CC=/opt/homebrew/opt/llvm@15/bin/clang" >> $GITHUB_ENV + echo "CXX=/opt/homebrew/opt/llvm@15/bin/clang++" >> $GITHUB_ENV + fi + fi + echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV + env: + compiler: ${{ matrix.compiler }} + + - name: Setup Compiler on Linux + if: runner.os == 'Linux' + shell: bash + run: | + # https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html + vers="${compiler#*-}" + os_codename="`cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2`" + if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then + sudo apt install -y gcc-${vers} g++-${vers} lld + echo "CC=gcc-${vers}" >> $GITHUB_ENV + echo "CXX=g++-${vers}" >> $GITHUB_ENV + else + if ! sudo apt install -y clang-${vers}; then + curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list + sudo apt-get update + sudo apt-get install -y clang-${vers} + fi + echo "CC=clang-${vers}" >> $GITHUB_ENV + echo "CXX=clang++-${vers}" >> $GITHUB_ENV + fi + env: + compiler: ${{ matrix.compiler }} + + - name: Save Compiler on Windows Systems + if: runner.os == 'Windows' + shell: powershell + run: | + if ( "${{ matrix.compiler }}" -imatch "clang" ) + { + $ver="${{ matrix.compiler }}".split("-")[1] + choco install llvm --version=$ver --no-progress -my + clang --version + # + $env:CC="clang" + $env:CXX="clang++" + echo "CC=clang" >> $env:GITHUB_ENV + echo "CXX=clang++" >> $env:GITHUB_ENV + } + elseif ( "${{ matrix.compiler }}" -imatch "msvc" ) + { + # MSVC is builtin in container image + } + else + { + echo "Unsupported compiler - fix YAML file" + } diff --git a/.github/workflows/MacOS-arm.yml b/.github/workflows/MacOS-arm.yml deleted file mode 100644 index fc52ff285..000000000 --- a/.github/workflows/MacOS-arm.yml +++ /dev/null @@ -1,197 +0,0 @@ -name: OSX-arm - -on: - pull_request: - branches: [main] - push: - branches: [main] - release: - types: [published] - schedule: - - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - name: osx15-arm-clang-clang-repl-20 - os: macos-15 - compiler: clang - clang-runtime: '20' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx15-arm-clang-clang-repl-19-cppyy - os: macos-15 - compiler: clang - clang-runtime: '19' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx15-arm-clang-clang-repl-18-cppyy - os: macos-15 - compiler: clang - clang-runtime: '18' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx15-arm-clang-clang-repl-17-cppyy - os: macos-15 - compiler: clang - clang-runtime: '17' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx15-arm-clang-clang-repl-16 - os: macos-15 - compiler: clang - clang-runtime: '16' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx15-arm-clang-clang18-cling-cppyy - os: macos-15 - compiler: clang - clang-runtime: '18' - cling: On - cppyy: On - cling-version: '1.2' - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Save PR Info - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "$cling_on" == "ON" ]]; then - export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') - export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') - else - export CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') - fi - - echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - - - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/restore@v4 - id: cache - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} - - - name: Setup default Build Type - run: | - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - echo "CODE_COVERAGE=0" >> $GITHUB_ENV - echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - - - name: Setup compiler - run: | - vers="${compiler#*-}" - if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then - brew install "gcc@$vers" - echo "CC=gcc-${vers}" >> $GITHUB_ENV - echo "CXX=g++-${vers}" >> $GITHUB_ENV - else - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "${cling_on}" == "ON" ]]; then - brew install llvm@15 - brew remove llvm@18 - brew cleanup - #FIXME: Do not believe setting all these environment variables are necessary - # They were set to avoid using Xcodes libc++ and to stop CppInterOp using llvm@18 in tests - echo 'LDFLAGS="-L/opt/homebrew/opt/llvm@15/lib/ -L/opt/homebrew/opt/llvm@15/c++/"' >> $GITHUB_ENV - echo 'CPPFLAGS="-I/opt/homebrew/opt/llvm@15/include"' >> $GITHUB_ENV - echo 'CPATH="/opt/homebrew/include/"' >> $GITHUB_ENV - echo 'LIBRARY_PATH="/opt/homebrew/lib/"' >> $GITHUB_ENV - echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV - echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV - else - echo "CC=$(brew --prefix llvm@18)/bin/clang" >> $GITHUB_ENV - echo "CXX=$(brew --prefix llvm@18)/bin/clang++" >> $GITHUB_ENV - fi - fi - echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV - env: - compiler: ${{ matrix.compiler }} - - - name: Install deps - run: | - brew update --force - brew remove unxip - # workaround for https://github.com/actions/setup-python/issues/577 - for pkg in $(brew list | grep '^python@'); do - brew unlink "$pkg" - brew link --overwrite "$pkg" - done - brew upgrade openssl >/dev/null 2>&1 - brew upgrade --force - brew install ninja - brew install eigen - brew install boost - brew install gnu-sed - pip install distro pytest - - - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} - uses: ./.github/actions/Build_LLVM - with: - cache-hit: ${{ steps.cache.outputs.cache-hit }} - - - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/save@v4 - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - - name: Build and test CppInterOp - uses: ./.github/actions/Build_and_Test_CppInterOp - - - name: Build and test cppyy - uses: ./.github/actions/Build_and_Test_cppyy - - - name: Show debug info - if: ${{ failure() }} - run: | - export - echo $GITHUB_ENV - - - name: Setup tmate session - if: ${{ failure() && runner.debug }} - uses: mxschmitt/action-tmate@v3 - # When debugging increase to a suitable value! - timeout-minutes: 30 diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml deleted file mode 100644 index 0e4abe796..000000000 --- a/.github/workflows/MacOS.yml +++ /dev/null @@ -1,182 +0,0 @@ -name: OSX-x86 - -on: - pull_request: - branches: [main] - push: - branches: [main] - release: - types: [published] - schedule: - - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - name: osx13-x86-clang-clang-repl-20 - os: macos-13 - compiler: clang - clang-runtime: '20' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx13-x86-clang-clang-repl-19-cppyy - os: macos-13 - compiler: clang - clang-runtime: '19' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx13-x86-clang-clang-repl-18-cppyy - os: macos-13 - compiler: clang - clang-runtime: '18' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx13-x86-clang-clang-repl-17-cppyy - os: macos-13 - compiler: clang - clang-runtime: '17' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx13-x86-clang-clang-repl-16 - os: macos-13 - compiler: clang - clang-runtime: '16' - cling: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host" - - name: osx13-x86-clang-clang18-cling-cppyy - os: macos-13 - compiler: clang - clang-runtime: '18' - cling: On - cppyy: On - cling-version: '1.2' - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Save PR Info - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "$cling_on" == "ON" ]]; then - export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') - export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') - else - export CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') - fi - - echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - - - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/restore@v4 - id: cache - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} - - - name: Setup default Build Type - run: | - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - echo "CODE_COVERAGE=0" >> $GITHUB_ENV - echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - - - name: Setup compiler - run: | - vers="${compiler#*-}" - if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then - brew install "gcc@$vers" - echo "CC=gcc-${vers}" >> $GITHUB_ENV - echo "CXX=g++-${vers}" >> $GITHUB_ENV - else - echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV - echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV - fi - echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV - env: - compiler: ${{ matrix.compiler }} - - - name: Install deps - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - run: | - brew update --force - brew remove swiftlint - # workaround for https://github.com/actions/setup-python/issues/577 - for pkg in $(brew list | grep '^python@'); do - brew unlink "$pkg" - brew link --overwrite "$pkg" - done - brew upgrade openssl >/dev/null 2>&1 - brew upgrade --force - brew install ninja - brew install eigen - brew install boost - brew install gnu-sed - pip install distro pytest - - - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} - uses: ./.github/actions/Build_LLVM - with: - cache-hit: ${{ steps.cache.outputs.cache-hit }} - - - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/save@v4 - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - - name: Build and test CppInterOp - uses: ./.github/actions/Build_and_Test_CppInterOp - - - name: Build and test cppyy - uses: ./.github/actions/Build_and_Test_cppyy - - - name: Show debug info - if: ${{ failure() }} - run: | - export - echo $GITHUB_ENV - - - name: Setup tmate session - if: ${{ failure() && runner.debug }} - uses: mxschmitt/action-tmate@v3 - # When debugging increase to a suitable value! - timeout-minutes: 30 diff --git a/.github/workflows/Ubuntu-arm.yml b/.github/workflows/Ubuntu-arm.yml deleted file mode 100644 index 8ab0c6e3f..000000000 --- a/.github/workflows/Ubuntu-arm.yml +++ /dev/null @@ -1,224 +0,0 @@ -name: Ubuntu-arm - -on: - pull_request: - branches: [main] - push: - branches: [main] - release: - types: [published] - schedule: - - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - name: ubu22-arm-gcc12-clang-repl-20-coverage - os: ubuntu-22.04-arm - compiler: gcc-12 - clang-runtime: '20' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - coverage: true - - name: ubu24-arm-gcc12-clang-repl-20 - os: ubuntu-24.04-arm - compiler: gcc-12 - clang-runtime: '20' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-arm-gcc12-clang-repl-19-cppyy - os: ubuntu-24.04-arm - compiler: gcc-12 - clang-runtime: '19' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-arm-gcc12-clang-repl-18-cppyy - os: ubuntu-24.04-arm - compiler: gcc-12 - clang-runtime: '18' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-arm-gcc12-clang-repl-17-cppyy - os: ubuntu-24.04-arm - compiler: gcc-12 - clang-runtime: '17' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-arm-gcc12-clang-repl-16 - os: ubuntu-24.04-arm - compiler: gcc-12 - clang-runtime: '16' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-arm-gcc9-clang18-cling-cppyy - os: ubuntu-24.04-arm - compiler: gcc-9 - clang-runtime: '18' - cling: On - cppyy: Off - cling-version: '1.2' - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Save PR Info - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "$cling_on" == "ON" ]]; then - export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') - export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') - else - export CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') - fi - - echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - - - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/restore@v4 - id: cache - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} - - - name: Setup default Build Type - run: | - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - echo "CODE_COVERAGE=0" >> $GITHUB_ENV - echo "ncpus=$(nproc --all)" >> $GITHUB_ENV - - - name: Setup compiler - run: | - # https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html - vers="${compiler#*-}" - os_codename="`cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2`" - ##sudo apt update - if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then - sudo apt install -y gcc-${vers} g++-${vers} lld - echo "CC=gcc-${vers}" >> $GITHUB_ENV - echo "CXX=g++-${vers}" >> $GITHUB_ENV - else - if ! sudo apt install -y clang-${vers}; then - curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list - sudo apt-get update - sudo apt-get install -y clang-${vers} - fi - echo "CC=clang-${vers}" >> $GITHUB_ENV - echo "CXX=clang++-${vers}" >> $GITHUB_ENV - fi - env: - compiler: ${{ matrix.compiler }} - - - name: Install deps - run: | - # Install deps - sudo apt-get update - sudo apt-get install valgrind ninja-build - sudo apt-get install git g++ debhelper devscripts gnupg python3 doxygen graphviz python3-sphinx - sudo apt-get install -y libc6-dbg - sudo apt-get install valgrind - sudo apt autoremove - sudo apt clean - # Install libraries used by the cppyy test suite - sudo apt install libeigen3-dev - sudo apt install libboost-all-dev - - - - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} - uses: ./.github/actions/Build_LLVM - with: - cache-hit: ${{ steps.cache.outputs.cache-hit }} - - - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/save@v4 - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - - name: Setup code coverage - if: ${{ success() && (matrix.coverage == true) }} - run: | - sudo apt install lcov - echo "CODE_COVERAGE=1" >> $GITHUB_ENV - echo "BUILD_TYPE=Debug" >> $GITHUB_ENV - - - name: Build and test CppInterOp - uses: ./.github/actions/Build_and_Test_CppInterOp - - - name: Prepare code coverage report - if: ${{ success() && (matrix.coverage == true) }} - run: | - # Create lcov report - # capture coverage info - vers="${CC#*-}" - lcov --directory build/ --capture --output-file coverage.info --gcov-tool /usr/bin/gcov-${vers} - lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' ${{ github.workspace }}'/llvm-project/*' ${{ github.workspace }}'/unittests/*' --output-file coverage.info - # output coverage data for debugging (optional) - lcov --list coverage.info - - - name: Upload to codecov.io - if: ${{ success() && (matrix.coverage == true) }} - uses: codecov/codecov-action@v5 - with: - files: ./coverage.info - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Build and test cppyy - uses: ./.github/actions/Build_and_Test_cppyy - - - name: Show debug info - if: ${{ failure() }} - run: | - export - echo $GITHUB_ENV - - - name: Setup tmate session - if: ${{ failure() && runner.debug }} - uses: mxschmitt/action-tmate@v3 - # When debugging increase to a suitable value! - timeout-minutes: 30 diff --git a/.github/workflows/Ubuntu.yml b/.github/workflows/Ubuntu.yml deleted file mode 100644 index 07c7040f7..000000000 --- a/.github/workflows/Ubuntu.yml +++ /dev/null @@ -1,213 +0,0 @@ -name: Ubuntu-x86 - -on: - pull_request: - branches: [main] - push: - branches: [main] - release: - types: [published] - schedule: - - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - name: ubu24-x86-gcc12-clang-repl-20 - os: ubuntu-24.04 - compiler: gcc-12 - clang-runtime: '20' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-x86-gcc12-clang-repl-19-cppyy - os: ubuntu-24.04 - compiler: gcc-12 - clang-runtime: '19' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-x86-gcc12-clang-repl-18-cppyy - os: ubuntu-24.04 - compiler: gcc-12 - clang-runtime: '18' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-x86-gcc12-clang-repl-17-cppyy - os: ubuntu-24.04 - compiler: gcc-12 - clang-runtime: '17' - cling: Off - cppyy: On - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-x86-gcc12-clang-repl-16 - os: ubuntu-24.04 - compiler: gcc-12 - clang-runtime: '16' - cling: Off - cppyy: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: ubu24-x86-gcc9-clang18-cling-cppyy - os: ubuntu-24.04 - compiler: gcc-9 - clang-runtime: '18' - cling: On - cppyy: Off - cling-version: '1.2' - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Save PR Info - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "$cling_on" == "ON" ]]; then - export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') - export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') - else - export CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') - fi - - echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - - - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/restore@v4 - id: cache - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} - - - name: Setup default Build Type - run: | - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - echo "CODE_COVERAGE=0" >> $GITHUB_ENV - echo "ncpus=$(nproc --all)" >> $GITHUB_ENV - - - name: Setup compiler - run: | - # https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html - vers="${compiler#*-}" - os_codename="`cat /etc/os-release | grep UBUNTU_CODENAME | cut -d = -f 2`" - ##sudo apt update - if [[ "${{ matrix.compiler }}" == *"gcc"* ]]; then - sudo apt install -y gcc-${vers} g++-${vers} lld - echo "CC=gcc-${vers}" >> $GITHUB_ENV - echo "CXX=g++-${vers}" >> $GITHUB_ENV - else - if ! sudo apt install -y clang-${vers}; then - curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - echo "deb https://apt.llvm.org/${os_codename}/ llvm-toolchain-${os_codename}-${vers} main" | sudo tee -a /etc/apt/sources.list - sudo apt-get update - sudo apt-get install -y clang-${vers} - fi - echo "CC=clang-${vers}" >> $GITHUB_ENV - echo "CXX=clang++-${vers}" >> $GITHUB_ENV - fi - env: - compiler: ${{ matrix.compiler }} - - - name: Install deps - run: | - # Install deps - sudo apt-get update - sudo apt-get install valgrind ninja-build - sudo apt-get install git g++ debhelper devscripts gnupg python3 doxygen graphviz python3-sphinx - sudo apt-get install -y libc6-dbg - sudo apt autoremove - sudo apt clean - # Install libraries used by the cppyy test suite - sudo apt install libeigen3-dev - sudo apt install libboost-all-dev - - - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} - uses: ./.github/actions/Build_LLVM - with: - cache-hit: ${{ steps.cache.outputs.cache-hit }} - - - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/save@v4 - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - - name: Setup code coverage - if: ${{ success() && (matrix.coverage == true) }} - run: | - sudo apt install lcov - echo "CODE_COVERAGE=1" >> $GITHUB_ENV - echo "BUILD_TYPE=Debug" >> $GITHUB_ENV - - - name: Build and test CppInterOp - uses: ./.github/actions/Build_and_Test_CppInterOp - - - name: Prepare code coverage report - if: ${{ success() && (matrix.coverage == true) }} - run: | - # Create lcov report - # capture coverage info - vers="${CC#*-}" - lcov --directory build/ --capture --output-file coverage.info --gcov-tool /usr/bin/gcov-${vers} - lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' ${{ github.workspace }}'/llvm-project/*' ${{ github.workspace }}'/unittests/*' --output-file coverage.info - # output coverage data for debugging (optional) - lcov --list coverage.info - - - name: Upload to codecov.io - if: ${{ success() && (matrix.coverage == true) }} - uses: codecov/codecov-action@v5 - with: - files: ./coverage.info - fail_ci_if_error: true - verbose: true - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Build and test cppyy - uses: ./.github/actions/Build_and_Test_cppyy - - - name: Show debug info - if: ${{ failure() }} - run: | - export - echo $GITHUB_ENV - - - name: Setup tmate session - if: ${{ failure() && runner.debug }} - uses: mxschmitt/action-tmate@v3 - # When debugging increase to a suitable value! - timeout-minutes: 30 diff --git a/.github/workflows/Windows-arm.yml b/.github/workflows/Windows-arm.yml deleted file mode 100644 index 3198abd48..000000000 --- a/.github/workflows/Windows-arm.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: Windows-arm -on: - pull_request: - branches: [main] - push: - branches: [main] - release: - types: [published] - schedule: - - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - name: win11-msvc-clang-repl-20 - os: windows-11-arm - compiler: msvc - clang-runtime: '20' - cling: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: win11-msvc-clang18-cling - os: windows-11-arm - compiler: msvc - clang-runtime: '18' - cling: On - cling-version: '1.2' - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Save PR Info on Windows systems - run: | - #can be found - mkdir ./pr - echo "${{ github.event.number }}" > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - if ( "${{ matrix.cling }}" -imatch "On" ) - { - $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) - $env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-" - } - else - { - $env:CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - $env:LLVM_HASH_TEMP = (git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x ) - $env:LLVM_HASH = $env:LLVM_HASH_TEMP -replace "\t","-" - } - - echo "CLING_HASH=$env:CLING_HASH" - echo "LLVM_HASH=$env:LLVM_HASH" - - echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV - - - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/restore@v4 - id: cache - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} - - - name: Setup default Build Type on Windows - run: | - echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV - echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV - $env:ncpus=$([Environment]::ProcessorCount) - echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV - - - name: Setup compiler on Windows - run: | - if ( "${{ matrix.compiler }}" -imatch "clang" ) - { - $ver="${{ matrix.compiler }}".split("-")[1] - choco install llvm --version=$ver --no-progress -my - clang --version - # - $env:CC="clang" - $env:CXX="clang++" - echo "CC=clang" >> $env:GITHUB_ENV - echo "CXX=clang++" >> $env:GITHUB_ENV - } - elseif ( "${{ matrix.compiler }}" -imatch "msvc" ) - { - # MSVC is builtin in container image - } - else - { - echo "Unsupported compiler - fix YAML file" - } - - - name: Install deps on Windows - run: | - choco install findutils - $env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH" - - - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} - uses: ./.github/actions/Build_LLVM - with: - cache-hit: ${{ steps.cache.outputs.cache-hit }} - - - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/save@v4 - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - - name: Build and test CppInterOp - uses: ./.github/actions/Build_and_Test_CppInterOp - - - name: Setup tmate session - if: ${{ failure() && runner.debug }} - uses: mxschmitt/action-tmate@v3 - # When debugging increase to a suitable value! - timeout-minutes: 30 diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml deleted file mode 100644 index d10b05afa..000000000 --- a/.github/workflows/Windows.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: Windows -on: - pull_request: - branches: [main] - push: - branches: [main] - release: - types: [published] - schedule: - - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number }} - cancel-in-progress: true - -jobs: - build: - name: ${{ matrix.name }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - name: win2025-msvc-clang-repl-20 - os: windows-2025 - compiler: msvc - clang-runtime: '20' - cling: Off - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - name: win2025-msvc-clang18-cling - os: windows-2025 - compiler: msvc - clang-runtime: '18' - cling: On - cling-version: '1.2' - llvm_enable_projects: "clang" - llvm_targets_to_build: "host;NVPTX" - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Save PR Info on Windows systems - run: | - #can be found - mkdir ./pr - echo "${{ github.event.number }}" > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - if ( "${{ matrix.cling }}" -imatch "On" ) - { - $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) - $env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-" - } - else - { - $env:CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - $env:LLVM_HASH_TEMP = (git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x ) - $env:LLVM_HASH = $env:LLVM_HASH_TEMP -replace "\t","-" - } - - echo "CLING_HASH=$env:CLING_HASH" - echo "LLVM_HASH=$env:LLVM_HASH" - - echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV - - - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/restore@v4 - id: cache - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} - - - name: Setup default Build Type on Windows - run: | - echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV - echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV - $env:ncpus=$([Environment]::ProcessorCount) - echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV - - - name: Setup compiler on Windows - run: | - if ( "${{ matrix.compiler }}" -imatch "clang" ) - { - $ver="${{ matrix.compiler }}".split("-")[1] - choco install llvm --version=$ver --no-progress -my - clang --version - # - $env:CC="clang" - $env:CXX="clang++" - echo "CC=clang" >> $env:GITHUB_ENV - echo "CXX=clang++" >> $env:GITHUB_ENV - } - elseif ( "${{ matrix.compiler }}" -imatch "msvc" ) - { - # MSVC is builtin in container image - } - else - { - echo "Unsupported compiler - fix YAML file" - } - - - name: Install deps on Windows - run: | - choco install findutils - $env:PATH="C:\Program Files (x86)\GnuWin32\bin;$env:PATH" - - - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} - uses: ./.github/actions/Build_LLVM - with: - cache-hit: ${{ steps.cache.outputs.cache-hit }} - - - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build - uses: actions/cache/save@v4 - if: ${{ steps.cache.outputs.cache-hit != 'true' }} - with: - path: | - llvm-project - ${{ matrix.cling=='On' && 'cling' || '' }} - key: ${{ steps.cache.outputs.cache-primary-key }} - - - name: Build and test CppInterOp - uses: ./.github/actions/Build_and_Test_CppInterOp - - - name: Setup tmate session - if: ${{ failure() && runner.debug }} - uses: mxschmitt/action-tmate@v3 - # When debugging increase to a suitable value! - timeout-minutes: 30 diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 06b1acb3d..e6f352d29 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -38,33 +38,11 @@ jobs: with: python-version: '3.11' - - name: Save PR Info on Unix systems - if: ${{ runner.os != 'windows' }} - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "$cling_on" == "ON" ]]; then - export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') - export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') - else - export CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') - fi + - name: Save PR Info + uses: ./.github/actions/Miscellaneous/Save_PR_Info - echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - - - name: Setup default Build Type on *nux - if: runner.os != 'windows' - run: | - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - echo "CODE_COVERAGE=0" >> $GITHUB_ENV - echo "ncpus=$(nproc --all)" >> $GITHUB_ENV + - name: Setup default Build Type + uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type - name: install mamba uses: mamba-org/setup-micromamba@main diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index fba426f5d..8fdc98cd6 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -88,54 +88,8 @@ jobs: with: python-version: '3.11' - - name: Save PR Info on Unix systems - if: ${{ runner.os != 'windows' }} - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "$cling_on" == "ON" ]]; then - export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') - export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') - else - export CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') - fi - - echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - - - name: Save PR Info on Windows systems - if: ${{ runner.os == 'windows' }} - run: | - #can be found - mkdir ./pr - echo "${{ github.event.number }}" > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO - - if ( "${{ matrix.cling }}" -imatch "On" ) - { - $env:CLING_HASH_TEMP = ( git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} ) - $env:CLING_HASH = $env:CLING_HASH_TEMP -replace "\t","-" - } - else - { - $env:CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - $env:LLVM_HASH_TEMP = (git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x ) - $env:LLVM_HASH = $env:LLVM_HASH_TEMP -replace "\t","-" - } - - echo "CLING_HASH=$env:CLING_HASH" - echo "LLVM_HASH=$env:LLVM_HASH" - - echo "CLING_HASH=$env:CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$env:LLVM_HASH" >> $GITHUB_ENV + - name: Save PR Info + uses: ./.github/actions/Miscellaneous/Save_PR_Info - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build (Unix like systems emscripten) uses: actions/cache/restore@v4 @@ -154,19 +108,8 @@ jobs: cd emsdk ./emsdk install ${{ matrix.emsdk_ver }} - - name: Setup default Build Type on *nux - if: ${{ runner.os != 'windows' && steps.cache.outputs.cache-hit != 'true' }} - run: | - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - echo "CODE_COVERAGE=0" >> $GITHUB_ENV - - - name: Setup default Build Type on Windows - if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }} - run: | - echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV - echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV - $env:ncpus=$([Environment]::ProcessorCount) - echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV + - name: Setup default Build Type + uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type - name: Install deps on Windows if: ${{ runner.os == 'windows' && steps.cache.outputs.cache-hit != 'true' }} @@ -486,46 +429,14 @@ jobs: with: fetch-depth: 0 - - name: Save PR Info on Unix systems - if: ${{ runner.os != 'windows' }} - run: | - mkdir -p ./pr - echo ${{ github.event.number }} > ./pr/NR - echo ${{ github.repository }} > ./pr/REPO + - name: Save PR Info + uses: ./.github/actions/Miscellaneous/Save_PR_Info - cling_on=$(echo "${{ matrix.cling }}" | tr '[:lower:]' '[:upper:]') - if [[ "$cling_on" == "ON" ]]; then - export CLING_HASH=$(git ls-remote https://github.com/root-project/cling.git refs/tags/v${{ matrix.cling-version }} | tr '\t' '-') - export LLVM_HASH=$(git ls-remote https://github.com/root-project/llvm-project.git cling-llvm${{ matrix.clang-runtime}} | tr '\t' '-') - else - export CLING_HASH="Repl" - # May need to revert back to both having same llvm_hash, as below cause llvm to be rebuilt everytime commit is made to llvm/llvm-project for release a.x - # which could be quite often for new releases - export LLVM_HASH=$(git ls-remote https://github.com/llvm/llvm-project.git refs/heads/release/${{ matrix.clang-runtime}}.x | tr '\t' '-') - fi + - name: Setup default Build Type + uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type - echo "CLING_HASH=$CLING_HASH" >> $GITHUB_ENV - echo "LLVM_HASH=$LLVM_HASH" >> $GITHUB_ENV - - - name: Setup default Build Type on *nux - if: runner.os != 'windows' - run: | - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - echo "CODE_COVERAGE=0" >> $GITHUB_ENV - os="${{ matrix.os }}" - if [[ "${os}" == "macos"* ]]; then - echo "ncpus=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV - else - echo "ncpus=$(nproc --all)" >> $GITHUB_ENV - fi - - - name: Setup default Build Type on Windows - if: ${{ runner.os == 'windows' }} - run: | - echo "BUILD_TYPE=Release" >> $env:GITHUB_ENV - echo "CODE_COVERAGE=0" >> $env:GITHUB_ENV - $env:ncpus=$([Environment]::ProcessorCount) - echo "ncpus=$env:ncpus" >> $env:GITHUB_ENV + - name: Setup default Build Type + uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type - name: install mamba uses: mamba-org/setup-micromamba@main diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..669958da3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,354 @@ +name: Native Builds + +on: + pull_request: + branches: [main] + push: + branches: [main] + release: + types: [published] + schedule: + - cron: '30 20 * * *' # Warning: Timezone dep - 20:00 is 1:00 + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + build: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + # Ubuntu Arm Jobs + - name: ubu22-arm-gcc12-clang-repl-20-coverage + os: ubuntu-22.04-arm + compiler: gcc-12 + clang-runtime: '20' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + coverage: true + - name: ubu24-arm-gcc12-clang-repl-20 + os: ubuntu-24.04-arm + compiler: gcc-12 + clang-runtime: '20' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-arm-gcc12-clang-repl-19-cppyy + os: ubuntu-24.04-arm + compiler: gcc-12 + clang-runtime: '19' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-arm-gcc12-clang-repl-18-cppyy + os: ubuntu-24.04-arm + compiler: gcc-12 + clang-runtime: '18' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-arm-gcc12-clang-repl-17-cppyy + os: ubuntu-24.04-arm + compiler: gcc-12 + clang-runtime: '17' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-arm-gcc12-clang-repl-16 + os: ubuntu-24.04-arm + compiler: gcc-12 + clang-runtime: '16' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-arm-gcc9-clang18-cling-cppyy + os: ubuntu-24.04-arm + compiler: gcc-9 + clang-runtime: '18' + cling: On + cppyy: Off + cling-version: '1.2' + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + # Ubuntu X86 Jobs + - name: ubu24-x86-gcc12-clang-repl-20 + os: ubuntu-24.04 + compiler: gcc-12 + clang-runtime: '20' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-x86-gcc12-clang-repl-19-cppyy + os: ubuntu-24.04 + compiler: gcc-12 + clang-runtime: '19' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-x86-gcc12-clang-repl-18-cppyy + os: ubuntu-24.04 + compiler: gcc-12 + clang-runtime: '18' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-x86-gcc12-clang-repl-17-cppyy + os: ubuntu-24.04 + compiler: gcc-12 + clang-runtime: '17' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-x86-gcc12-clang-repl-16 + os: ubuntu-24.04 + compiler: gcc-12 + clang-runtime: '16' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: ubu24-x86-gcc9-clang18-cling-cppyy + os: ubuntu-24.04 + compiler: gcc-9 + clang-runtime: '18' + cling: On + cppyy: Off + cling-version: '1.2' + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + # MacOS Arm Jobs + - name: osx15-arm-clang-clang-repl-20 + os: macos-15 + compiler: clang + clang-runtime: '20' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx15-arm-clang-clang-repl-19-cppyy + os: macos-15 + compiler: clang + clang-runtime: '19' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx15-arm-clang-clang-repl-18-cppyy + os: macos-15 + compiler: clang + clang-runtime: '18' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx15-arm-clang-clang-repl-17-cppyy + os: macos-15 + compiler: clang + clang-runtime: '17' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx15-arm-clang-clang-repl-16 + os: macos-15 + compiler: clang + clang-runtime: '16' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx15-arm-clang-clang18-cling-cppyy + os: macos-15 + compiler: clang + clang-runtime: '18' + cling: On + cppyy: On + cling-version: '1.2' + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + # MacOS X86 Jobs + - name: osx13-x86-clang-clang-repl-20 + os: macos-13 + compiler: clang + clang-runtime: '20' + cling: Off + cppyy: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx13-x86-clang-clang-repl-19-cppyy + os: macos-13 + compiler: clang + clang-runtime: '19' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx13-x86-clang-clang-repl-18-cppyy + os: macos-13 + compiler: clang + clang-runtime: '18' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx13-x86-clang-clang-repl-17-cppyy + os: macos-13 + compiler: clang + clang-runtime: '17' + cling: Off + cppyy: On + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx13-x86-clang-clang-repl-16 + os: macos-13 + compiler: clang + clang-runtime: '16' + cling: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host" + - name: osx13-x86-clang-clang18-cling-cppyy + os: macos-13 + compiler: clang + clang-runtime: '18' + cling: On + cppyy: On + cling-version: '1.2' + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + # Windows Arm Jobs + - name: win11-msvc-clang-repl-20 + os: windows-11-arm + compiler: msvc + clang-runtime: '20' + cling: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: win11-msvc-clang18-cling + os: windows-11-arm + compiler: msvc + clang-runtime: '18' + cling: On + cling-version: '1.2' + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + # Windows X86 Jobs + - name: win2025-msvc-clang-repl-20 + os: windows-2025 + compiler: msvc + clang-runtime: '20' + cling: Off + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + - name: win2025-msvc-clang18-cling + os: windows-2025 + compiler: msvc + clang-runtime: '18' + cling: On + cling-version: '1.2' + llvm_enable_projects: "clang" + llvm_targets_to_build: "host;NVPTX" + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Save PR Info + uses: ./.github/actions/Miscellaneous/Save_PR_Info + + - name: Restore cached LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build + uses: actions/cache/restore@v4 + id: cache + with: + path: | + llvm-project + ${{ matrix.cling=='On' && 'cling' || '' }} + key: ${{ env.CLING_HASH }}-${{ runner.os }}-${{ matrix.os }}-${{ matrix.compiler }}-clang-${{ matrix.clang-runtime }}.x-patch-${{ hashFiles(format('patches/llvm/clang{0}-*.patch', matrix.clang-runtime)) || 'none' }} + + - name: Setup default Build Type + uses: ./.github/actions/Miscellaneous/Select_Default_Build_Type + + - name: Setup compiler + uses: ./.github/actions/Miscellaneous/Setup_Compiler + + - name: Install dependencies + uses: ./.github/actions/Miscellaneous/Install_Dependencies + + - name: Build LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} + uses: ./.github/actions/Build_LLVM + with: + cache-hit: ${{ steps.cache.outputs.cache-hit }} + + - name: Cache LLVM-${{ matrix.clang-runtime }} and ${{ matrix.cling == 'On' && 'Cling' || 'Clang-REPL' }} build + uses: actions/cache/save@v4 + if: ${{ steps.cache.outputs.cache-hit != 'true' }} + with: + path: | + llvm-project + ${{ matrix.cling=='On' && 'cling' || '' }} + key: ${{ steps.cache.outputs.cache-primary-key }} + + - name: Setup code coverage + if: ${{ success() && (matrix.coverage == true) }} + run: | + sudo apt install lcov + echo "CODE_COVERAGE=1" >> $GITHUB_ENV + echo "BUILD_TYPE=Debug" >> $GITHUB_ENV + + - name: Build and test CppInterOp + uses: ./.github/actions/Build_and_Test_CppInterOp + + - name: Prepare code coverage report + if: ${{ success() && (matrix.coverage == true) }} + run: | + # Create lcov report + # capture coverage info + vers="${CC#*-}" + lcov --directory build/ --capture --output-file coverage.info --gcov-tool /usr/bin/gcov-${vers} + lcov --remove coverage.info '/usr/*' "${HOME}"'/.cache/*' ${{ github.workspace }}'/llvm-project/*' ${{ github.workspace }}'/unittests/*' --output-file coverage.info + # output coverage data for debugging (optional) + lcov --list coverage.info + + - name: Upload to codecov.io + if: ${{ success() && (matrix.coverage == true) }} + uses: codecov/codecov-action@v5 + with: + files: ./coverage.info + fail_ci_if_error: true + verbose: true + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Build and test cppyy + uses: ./.github/actions/Build_and_Test_cppyy + + - name: Show debug info + if: ${{ failure() }} + run: | + export + echo $GITHUB_ENV + + - name: Setup tmate session + if: ${{ failure() && runner.debug }} + uses: mxschmitt/action-tmate@v3 + # When debugging increase to a suitable value! + timeout-minutes: 30 diff --git a/README.md b/README.md index 37f36fe15..534fc191e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@ # CppInterOp
-[![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/Ubuntu.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/Ubuntu.yml) -[![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/Ubuntu-arm.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/Ubuntu-arm.yml) -[![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/MacOS.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/MacOS.yml) -[![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/MacOS-arm.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/MacOS-arm.yml) -[![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/Windows.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/Windows.yml) -[![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/Windows-arm.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/Windows-arm.yml) +[![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/main.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/main.yml) [![Build Status](https://github.com/compiler-research/CppInterOp/actions/workflows/emscripten.yml/badge.svg)](https://github.com/compiler-research/CppInterOp/actions/workflows/emscripten.yml) [![codecov](https://codecov.io/gh/compiler-research/CppInterOp/branch/main/graph/badge.svg)](https://codecov.io/gh/compiler-research/CppInterOp) [![Conda-Forge](https://img.shields.io/conda/vn/conda-forge/cppinterop)](https://github.com/conda-forge/cppinterop-feedstock)