Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/root-ci-config/build_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ def main():
# file below overwrites values from above
**load_config(f'{this_script_dir}/buildconfig/{args.platform}.txt')
}

if WINDOWS and pull_request:
options_dict["clingtest"] = 'on' if args.clingtest else 'off'
options = build_utils.cmake_options_from_dict(options_dict)

if WINDOWS:
options = "-Thost=x64 " + options

Expand Down Expand Up @@ -195,6 +195,7 @@ def parse_args():
parser.add_argument("--dockeropts", default=None, help="Extra docker options, if any")
parser.add_argument("--incremental", default="false", help="Do incremental build")
parser.add_argument("--buildtype", default="Release", help="Release|Debug|RelWithDebInfo")
parser.add_argument("--clingtest", default="false", help="Build with -Dclingtest=ON for Windows PR CI")
parser.add_argument("--coverage", default="false", help="Create Coverage report in XML")
parser.add_argument("--sha", default=None, help="sha that triggered the event")
parser.add_argument("--base_ref", default=None, help="Ref to target branch")
Expand All @@ -210,6 +211,7 @@ def parse_args():

# Set argument to True if matched
args.incremental = args.incremental.lower() in ('yes', 'true', '1', 'on')
args.clingtest = args.clingtest.lower() in ('yes', 'true', '1', 'on')
args.coverage = args.coverage.lower() in ('yes', 'true', '1', 'on')
args.binaries = args.binaries.lower() in ('yes', 'true', '1', 'on')

Expand Down
48 changes: 44 additions & 4 deletions .github/workflows/root-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,36 @@ concurrency:
cancel-in-progress: true

jobs:
git_diff:
name: Detect changes in Cling
# https://www.meziantou.net/executing-github-actions-jobs-or-steps-only-when-specific-files-change.htm
runs-on: ubuntu-latest
# Declare output for next jobs
outputs:
interpreter_changed: ${{ steps.check_file_changed.outputs.interpreter_changed }}
steps:
- uses: actions/checkout@v4
with:
# Checkout as many commits as needed for the diff
fetch-depth: 2
- shell: pwsh
id: check_file_changed
run: |
# Diff HEAD with the latest commit of master
$diff = git diff --name-only HEAD^ HEAD
# (works with HEAD^ as the last commit fetched is virtual merge commit by GH which shows the full diff for the PR.)

# Check if a file under interpreter/ has changed
$SourceDiff = $diff | Where-Object { $_ -match '^interpreter/' }
$HasDiff = $SourceDiff.Length -gt 0

# Set the output named "interpreter_changed"
Write-Host "::set-output name=interpreter_changed::$HasDiff"
#echo "interpreter_changed=$HasDiff" >> $GITHUB_OUTPUT
echo "interpreter_changed=$HasDiff"

build-macos:
needs: [ git_diff ]
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] or [skip ci] is written in the title.
if: |
Expand All @@ -95,18 +124,19 @@ jobs:
# Common configs: {Release,Debug,RelWithDebInfo)
# Build options: https://root.cern/install/build_from_source/#all-build-options
include:
- platform: mac13
- platform: mac13
arch: ARM64
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "builtin_zlib=ON"]
- platform: mac14
arch: X64
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20", "clingtest=${{needs.git_diff.outputs.interpreter_changed == 'true' && 'ON' || 'OFF'}}"]
- platform: mac15
arch: ARM64
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
- platform: mac-beta
arch: ARM64
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_CXX_STANDARD=20"]
# https://stackoverflow.com/questions/76292948/github-action-boolean-input-with-default-value

runs-on: # Using '[self-hosted, ..., ...]' does not work for some reason :)
- self-hosted
Expand All @@ -115,7 +145,7 @@ jobs:
- ${{ matrix.platform }}

name: |
${{ matrix.platform }} ${{ matrix.arch }}
${{ matrix.platform }} ${{ matrix.arch }}
${{ (github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && join( matrix.overrides, ', ' )) || '' }}

steps:
Expand Down Expand Up @@ -217,6 +247,7 @@ jobs:


build-windows:
needs: [ git_diff ]
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] or [skip ci] is written in the title.
if: |
Expand Down Expand Up @@ -271,6 +302,7 @@ jobs:
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--clingtest ${{ needs.git_diff.outputs.interpreter_changed }}
--platform windows10
--incremental $INCREMENTAL
--base_ref ${{ github.base_ref }}
Expand Down Expand Up @@ -314,6 +346,7 @@ jobs:
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--clingtest ${{ needs.git_diff.outputs.interpreter_changed }}
--platform windows10
--incremental false
--base_ref ${{ github.ref_name }}
Expand All @@ -338,6 +371,7 @@ jobs:


build-linux:
needs: [ git_diff ]
# For any event that is not a PR, the CI will always run. In PRs, the CI
# can be skipped if the tag [skip-ci] or [skip ci] is written in the title.
if: |
Expand All @@ -350,6 +384,11 @@ jobs:
strategy:
fail-fast: false
matrix:
# https://github.com/orgs/community/discussions/26253
# https://stackoverflow.com/questions/65384420/how-do-i-make-a-github-action-matrix-element-conditional
# https://stackoverflow.com/questions/68994484/how-to-skip-a-configuration-of-a-matrix-with-github-actions
# https://github.com/joaomcteixeira/python-project-skeleton/pull/31/files

# Specify image + (optional) build option overrides
#
# Available images: https://github.com/root-project/root-ci-images
Expand All @@ -363,7 +402,8 @@ jobs:
- image: alma8
overrides: ["LLVM_ENABLE_ASSERTIONS=On"]
- image: alma9
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
overrides: ["LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug", "clingtest=${{needs.git_diff.outputs.interpreter_changed == 'true' && 'ON' || 'OFF'}}"]
# https://stackoverflow.com/questions/76292948/github-action-boolean-input-with-default-value
- image: ubuntu22
overrides: ["imt=Off", "LLVM_ENABLE_ASSERTIONS=On", "CMAKE_BUILD_TYPE=Debug"]
- image: ubuntu2404
Expand Down
2 changes: 1 addition & 1 deletion interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Do not depend on CMake scripts from the rest of the ROOT build
# Do not depend on CMake scripts from the rest of the ROOT build
set(CMAKE_MODULE_PATH "")

#--- Check if we need to build llvm and clang ------------------------------------------------------
Expand Down