Skip to content

Commit 9769df0

Browse files
committed
fixup! [CI] Draft a homebrew-based macCI.
1 parent b3ca5fd commit 9769df0

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

.github/workflows/root-ci-config/build_root.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
die,
3131
github_log_group,
3232
is_macos,
33+
print_options_diff,
3334
subprocess_with_capture,
3435
subprocess_with_log,
3536
upload_file,
@@ -69,13 +70,17 @@ def main():
6970
# Load CMake options from .github/workflows/root-ci-config/buildconfig/[platform].txt
7071
this_script_dir = os.path.dirname(os.path.abspath(__file__))
7172

72-
override_dict = dict(arg.split("=") for arg in args.overrides)
73-
options_dict = {
74-
**build_utils.load_config(f"{this_script_dir}/buildconfig/global.txt"),
75-
# file below overwrites values from above
76-
**build_utils.load_config(f"{this_script_dir}/buildconfig/{args.platform}.txt"),
77-
**override_dict,
78-
}
73+
options_dict = build_utils.load_config(f"{this_script_dir}/buildconfig/global.txt")
74+
temp = dict(options_dict)
75+
options_dict.update(build_utils.load_config(f"{this_script_dir}/buildconfig/{args.platform}.txt"))
76+
print(f"Build options ({args.platform})")
77+
print_options_diff(options_dict, temp)
78+
79+
print("Build options (CI override):", args.overrides)
80+
if args.overrides is not None:
81+
temp = dict(options_dict)
82+
options_dict.update((arg.split("=") for arg in args.overrides))
83+
print_options_diff(options_dict, temp)
7984

8085
options = build_utils.cmake_options_from_dict(options_dict)
8186

.github/workflows/root-ci-config/build_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ def print_warning(*values, **kwargs):
108108
def print_error(*values, **kwargs):
109109
print_fancy("Fatal error: ", *values, sgr=31, **kwargs)
110110

111+
def print_options_diff(new, old):
112+
"""Print difference between build option dicts"""
113+
114+
for key in new:
115+
try:
116+
if new[key] != old[key]:
117+
print(f"\t{key}:\t{old[key]} --> {new[key]}")
118+
except:
119+
print(f"\t{key}:\tNone --> {new[key]}")
120+
111121

112122
def subprocess_with_log(command: str) -> int:
113123
"""Runs <command> in shell and appends <command> to log"""

.github/workflows/root-ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,13 @@ jobs:
152152
run: |
153153
$(brew --prefix python)/bin/python3 -m venv ROOT_CI
154154
source ROOT_CI/bin/activate
155-
echo PATH=$PATH >> $GITHUB_PATH
156155
pip install --upgrade pip
157-
cat ${{ github.workspace }}/src/requirements.txt | while read PACKAGE; do pip install -U "$PACKAGE"; done || true
156+
cat ${{ github.workspace }}/src/requirements.txt | while read PACKAGE; do
157+
if [ -n "${PACKAGE%%#*}" ]; then
158+
pip install -U "${PACKAGE%%#*}";
159+
fi; done || true
158160
pip install openstacksdk # TODO: Remove?
161+
echo $(pwd)/ROOT_CI/bin >> $GITHUB_PATH
159162
160163
- name: Apply option overrides from matrix for this job for non-release builds
161164
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && matrix.overrides != NaN }}
@@ -180,7 +183,8 @@ jobs:
180183
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
181184
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
182185
run: |
183-
source ROOT_CI/bin/activate
186+
echo $PATH
187+
if [ -f ROOT_CI/bin/activate ]; then source ROOT_CI/bin/activate; fi
184188
src/.github/workflows/root-ci-config/build_root.py \
185189
--buildtype RelWithDebInfo \
186190
--incremental $INCREMENTAL \
@@ -190,7 +194,7 @@ jobs:
190194
--head_ref refs/pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }} \
191195
--head_sha ${{ github.event.pull_request.head.sha }} \
192196
--repository ${{ github.server_url }}/${{ github.repository }} \
193-
--platform ${{ matrix.platform }} \
197+
--platform ${{ matrix.platform == 'experimental-brew-ci' && 'mac15' || matrix.platform }}
194198
--overrides $GLOBAL_OVERRIDES $OVERRIDES
195199
196200
- name: Workflow dispatch

0 commit comments

Comments
 (0)