Skip to content

Commit 6cee34a

Browse files
patnikoCopilot
andcommitted
Strengthen Python CI: py_compile + import check instead of AST-only
Install the Python SDK and use py_compile for proper compilation checking, plus verify the copilot module is importable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent db37c0f commit 6cee34a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/scenario-builds.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,17 @@ jobs:
7979
with:
8080
python-version: "3.12"
8181

82-
- name: Syntax-check all Python scenarios
82+
- name: Install Python SDK
83+
run: pip install -e python/
84+
85+
- name: Compile and import-check all Python scenarios
8386
run: |
8487
PASS=0; FAIL=0; FAILURES=""
8588
for main in $(find test/scenarios -path '*/python/main.py' | sort); do
8689
dir=$(dirname "$main")
8790
scenario="${dir#test/scenarios/}"
8891
echo "::group::$scenario"
89-
if python3 -c "import ast, sys; ast.parse(open('$main').read()); print('syntax ok')" 2>&1; then
92+
if python3 -m py_compile "$main" 2>&1 && python3 -c "import copilot" 2>&1; then
9093
echo "✅ $scenario"
9194
PASS=$((PASS + 1))
9295
else

0 commit comments

Comments
 (0)