1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-03 17:07:39 +03:00

get-ci-matrix.py: sort changed impls to the top.

For the case where there are code changes outside of the
implementation directories, sort the implementations that have actual
changes in their own directory to the top of the matrix.
This commit is contained in:
Joel Martin 2021-04-23 14:26:18 -05:00
parent 68c66f5f01
commit 1cf6e2f1a5

View File

@ -50,11 +50,15 @@ all_impls = yaml.safe_load(open(IMPLS_FILE))
linux_impls = []
macos_impls = []
for impl in all_impls['IMPL']:
if do_full or impl['IMPL'] in run_impls:
if 'OS' in impl and impl['OS'] == 'macos':
macos_impls.append(impl_text(impl))
else:
linux_impls.append(impl_text(impl))
targ = linux_impls
if 'OS' in impl and impl['OS'] == 'macos':
targ = macos_impls
# Run implementations with actual changes first before running
# other impls triggered by non-impl code changes
if impl['IMPL'] in run_impls:
targ.insert(0, impl_text(impl))
elif do_full:
targ.append(impl_text(impl))
print("::set-output name=do-linux::%s" % json.dumps(len(linux_impls)>0))
print("::set-output name=do-macos::%s" % json.dumps(len(macos_impls)>0))