ci: fix YAML parse error — replace Python heredoc with shell grep
Neuron Soul CI / build (push) Failing after 47s
Neuron Soul CI / build (push) Failing after 47s
This commit is contained in:
@@ -86,26 +86,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Generate ELP master declarations header
|
- name: Generate ELP master declarations header
|
||||||
run: |
|
run: |
|
||||||
python3 - <<'PYEOF'
|
{
|
||||||
import os, re
|
printf '/* Auto-generated C forward declarations for ELP cross-module calls */\n'
|
||||||
dist = 'dist'
|
printf '#pragma once\n'
|
||||||
decls = set()
|
printf '#include "el_runtime.h"\n'
|
||||||
guard_pat = re.compile(r'^(el_val_t|void|int|char\*|const char\*)\s+\w+\s*\(')
|
printf '\n'
|
||||||
for fn in sorted(os.listdir(dist)):
|
grep -h -E '^(el_val_t|void|int|char\*|const char\*)[[:space:]]+[a-zA-Z_][a-zA-Z0-9_]*[[:space:]]*\(' dist/*.c 2>/dev/null \
|
||||||
if not fn.endswith('.c'):
|
| grep ';$' | sort -u
|
||||||
continue
|
} > dist/elp-c-decls.h
|
||||||
with open(os.path.join(dist, fn)) as f:
|
echo "Generated elp-c-decls.h with $(grep -c ';' dist/elp-c-decls.h 2>/dev/null || echo 0) declarations"
|
||||||
for line in f:
|
|
||||||
line = line.rstrip()
|
|
||||||
if guard_pat.match(line) and line.endswith(';'):
|
|
||||||
decls.add(line)
|
|
||||||
header = ['/* Auto-generated C forward declarations for ELP cross-module calls */',
|
|
||||||
'#pragma once', '#include "el_runtime.h"', '']
|
|
||||||
header += sorted(decls)
|
|
||||||
with open(os.path.join(dist, 'elp-c-decls.h'), 'w') as f:
|
|
||||||
f.write('\n'.join(header) + '\n')
|
|
||||||
print(f"Generated elp-c-decls.h with {len(decls)} declarations")
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
- name: Build neuron soul binary
|
- name: Build neuron soul binary
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user