|
1 | 1 | name: CI Diagnose |
2 | | -on: |
3 | | - workflow_dispatch: {} |
4 | | - push: |
5 | | - branches: [ ci-debug/** ] |
6 | | -permissions: |
7 | | - contents: read |
| 2 | +on: { workflow_dispatch: {}, push: { branches: [ ci-debug/** ] }, pull_request: {} } |
| 3 | +permissions: { contents: read } |
8 | 4 |
|
9 | 5 | jobs: |
10 | 6 | diagnose: |
11 | 7 | runs-on: ubuntu-latest |
12 | 8 | steps: |
13 | 9 | - uses: actions/checkout@v4 |
| 10 | + |
14 | 11 | - name: Dump GitHub context |
15 | 12 | run: | |
16 | 13 | echo "event: ${{ github.event_name }}" |
17 | 14 | echo "ref: ${{ github.ref }}" |
18 | 15 | echo "sha: ${{ github.sha }}" |
| 16 | +
|
19 | 17 | - uses: actions/setup-python@v5 |
20 | 18 | with: { python-version: '3.12' } |
| 19 | + |
21 | 20 | - name: Python env |
22 | 21 | run: | |
23 | 22 | python --version |
24 | 23 | which python |
| 24 | +
|
25 | 25 | - name: Tree + key files |
26 | 26 | run: | |
27 | 27 | ls -la |
28 | | - echo "--- pyproject.toml ---"; [ -f pyproject.toml ] && sed -n '1,120p' pyproject.toml || echo "missing" |
29 | | - echo "--- setup.cfg ---"; [ -f setup.cfg ] && sed -n '1,120p' setup.cfg || echo "missing" |
| 28 | + echo "--- pyproject.toml ---"; [ -f pyproject.toml ] && sed -n '1,200p' pyproject.toml || echo "missing" |
| 29 | + echo "--- setup.cfg ---"; [ -f setup.cfg ] && sed -n '1,200p' setup.cfg || echo "missing" |
30 | 30 | echo "--- requirements*.txt ---"; ls -1 requirements*.txt 2>/dev/null || echo "none" |
| 31 | +
|
31 | 32 | - name: Test discovery |
32 | 33 | run: | |
33 | | - echo "tests tree:" |
34 | 34 | find tests -maxdepth 2 -type f -name "*.py" 2>/dev/null || echo "no tests dir" |
| 35 | +
|
35 | 36 | - name: Import sanity |
36 | 37 | env: { PYTHONPATH: ${{ github.workspace }} } |
37 | 38 | run: | |
38 | | - python - <<'PY' |
39 | | -try: |
40 | | - import crapssim as m |
41 | | - print("import crapssim OK:", getattr(m,'__file__',None)) |
42 | | -except Exception as e: |
43 | | - print("import crapssim FAILED:", e) |
44 | | -try: |
45 | | - import crapssim_api as m |
46 | | - print("import crapssim_api OK:", getattr(m,'__file__',None)) |
47 | | -except Exception as e: |
48 | | - print("import crapssim_api FAILED:", e) |
| 39 | + python - <<'PY' || true |
| 40 | +mods = ["crapssim","crapssim_api"] |
| 41 | +for m in mods: |
| 42 | + try: |
| 43 | + __import__(m); print("OK import:", m) |
| 44 | + except Exception as e: |
| 45 | + print("FAIL import:", m, "->", e) |
49 | 46 | PY |
0 commit comments