|
| 1 | +# CI: lint + fast unit tests on every push/PR; the engine-backed suites |
| 2 | +# (slow e2e, per-database integration) run when the PATHWAY_LICENSE_KEY |
| 3 | +# secret is configured and skip gracefully when it is not. |
| 4 | +# |
| 5 | +# All dependencies come from PyPI (pathway >= 0.32.1 ships everything |
| 6 | +# serviette needs); uv is kept for install speed only. |
| 7 | + |
| 8 | +name: CI |
| 9 | + |
| 10 | +on: |
| 11 | + push: |
| 12 | + branches: [main] |
| 13 | + pull_request: |
| 14 | + |
| 15 | +concurrency: |
| 16 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 17 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 18 | + |
| 19 | +jobs: |
| 20 | + lint-and-fast: |
| 21 | + name: lint + fast tests (py${{ matrix.python }}) |
| 22 | + runs-on: ubuntu-latest |
| 23 | + timeout-minutes: 45 |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + python: ["3.10", "3.12", "3.14"] |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - uses: actions/setup-python@v5 |
| 31 | + with: |
| 32 | + python-version: ${{ matrix.python }} |
| 33 | + - uses: actions/cache@v4 |
| 34 | + with: |
| 35 | + path: ~/.cache/uv |
| 36 | + key: uv-${{ runner.os }}-py${{ matrix.python }}-${{ hashFiles('pyproject.toml') }} |
| 37 | + - name: Install |
| 38 | + run: | |
| 39 | + pip install -U uv |
| 40 | + uv venv .venv |
| 41 | + # pyfilesystem here is a CI-environment choice, not a package |
| 42 | + # dependency: it keeps the optional-source tests exercised instead |
| 43 | + # of being skipped (they importorskip when the extra is absent). |
| 44 | + uv pip install --python .venv/bin/python -e ".[dev,local,pyfilesystem]" |
| 45 | + .venv/bin/python -c "import pathway; print('pathway', pathway.__version__)" |
| 46 | + - name: Ruff |
| 47 | + run: .venv/bin/python -m ruff check serviette tests |
| 48 | + - name: Fast tests |
| 49 | + run: .venv/bin/python -m pytest tests/ -m "not slow and not integration" -q |
| 50 | + |
| 51 | + slow: |
| 52 | + name: e2e indexer / up / demo smoke |
| 53 | + runs-on: ubuntu-latest |
| 54 | + timeout-minutes: 75 |
| 55 | + needs: lint-and-fast |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v4 |
| 58 | + - name: Check license secret |
| 59 | + id: license |
| 60 | + run: | |
| 61 | + if [ -n "${{ secrets.PATHWAY_LICENSE_KEY }}" ]; then |
| 62 | + echo "present=true" >> "$GITHUB_OUTPUT" |
| 63 | + else |
| 64 | + echo "present=false" >> "$GITHUB_OUTPUT" |
| 65 | + echo "::warning::PATHWAY_LICENSE_KEY secret is not set — skipping the engine-backed suite" |
| 66 | + fi |
| 67 | + - uses: actions/setup-python@v5 |
| 68 | + if: steps.license.outputs.present == 'true' |
| 69 | + with: |
| 70 | + python-version: "3.12" |
| 71 | + - uses: actions/cache@v4 |
| 72 | + if: steps.license.outputs.present == 'true' |
| 73 | + with: |
| 74 | + path: ~/.cache/uv |
| 75 | + key: uv-${{ runner.os }}-py3.12-${{ hashFiles('pyproject.toml') }} |
| 76 | + - name: Install |
| 77 | + if: steps.license.outputs.present == 'true' |
| 78 | + run: | |
| 79 | + pip install -U uv |
| 80 | + uv venv .venv |
| 81 | + uv pip install --python .venv/bin/python -e ".[dev,local,pyfilesystem]" |
| 82 | + - name: Slow tests (multimodal parser tests excluded — they download models) |
| 83 | + if: steps.license.outputs.present == 'true' |
| 84 | + env: |
| 85 | + PATHWAY_LICENSE_KEY: ${{ secrets.PATHWAY_LICENSE_KEY }} |
| 86 | + run: | |
| 87 | + .venv/bin/python -m pytest tests/ -m "slow and not integration" -q \ |
| 88 | + --ignore=tests/test_multimodal_parsers.py |
| 89 | +
|
| 90 | + integration: |
| 91 | + name: vector-DB integration matrix (docker) |
| 92 | + runs-on: ubuntu-latest |
| 93 | + timeout-minutes: 90 |
| 94 | + needs: lint-and-fast |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v4 |
| 97 | + - name: Check license secret |
| 98 | + id: license |
| 99 | + run: | |
| 100 | + if [ -n "${{ secrets.PATHWAY_LICENSE_KEY }}" ]; then |
| 101 | + echo "present=true" >> "$GITHUB_OUTPUT" |
| 102 | + else |
| 103 | + echo "present=false" >> "$GITHUB_OUTPUT" |
| 104 | + echo "::warning::PATHWAY_LICENSE_KEY secret is not set — skipping the integration matrix" |
| 105 | + fi |
| 106 | + - uses: actions/setup-python@v5 |
| 107 | + if: steps.license.outputs.present == 'true' |
| 108 | + with: |
| 109 | + python-version: "3.12" |
| 110 | + - uses: actions/cache@v4 |
| 111 | + if: steps.license.outputs.present == 'true' |
| 112 | + with: |
| 113 | + path: ~/.cache/uv |
| 114 | + key: uv-${{ runner.os }}-py3.12-${{ hashFiles('pyproject.toml') }} |
| 115 | + - name: Install |
| 116 | + if: steps.license.outputs.present == 'true' |
| 117 | + run: | |
| 118 | + pip install -U uv |
| 119 | + uv venv .venv |
| 120 | + uv pip install --python .venv/bin/python -e ".[dev,all,local,pyfilesystem,sharepoint]" |
| 121 | + - name: Integration tests |
| 122 | + if: steps.license.outputs.present == 'true' |
| 123 | + env: |
| 124 | + PATHWAY_LICENSE_KEY: ${{ secrets.PATHWAY_LICENSE_KEY }} |
| 125 | + run: .venv/bin/python -m pytest tests/ -m integration -q |
0 commit comments