This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | ||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| pull_request: | ||
| branches: [ main, master ] | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: [3.14] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Cache pip | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | ||
| - name: Install dependencies | ||
| run: python -m pip install --upgrade pip build | ||
| - name: Install package and test deps (install inner package dir) | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| # install the package directory explicitly (editable) and extras for testing | ||
| python -m pip install -e ./GabesPythonToolBox[testing] | ||
| - name: Debug repository layout (helpful if imports still fail) | ||
| run: | | ||
| python - <<'PY' | ||
| import sys, os | ||
| print("cwd:", os.getcwd()) | ||
| print("PYTHONPATH env:", os.environ.get("PYTHONPATH")) | ||
| print("sys.path:") | ||
| for p in sys.path: | ||
| print(" ", p) | ||
| print("\nTop-level files and dirs:") | ||
| print(os.listdir(".")) | ||
| try: | ||
| import GabesPythonToolBox | ||
| print("Imported GabesPythonToolBox from:", getattr(GabesPythonToolBox, "__file__", repr(GabesPythonToolBox))) | ||
| except Exception as e: | ||
| print("Importing GabesPythonToolBox failed:", type(e).__name__, e) | ||
| PY | ||
| - name: Ensure repo on PYTHONPATH for tests | ||
| run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV | ||
| - name: Run tests | ||
| run: pytest -q --cov=GabesPythonToolBox --cov-report=xml | ||
| - name: Upload coverage to artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-xml | ||
| path: coverage.xml | ||