diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ac5cf9c --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,62 @@ +name: tests + +on: + push: + branches: [main] + pull_request: + +jobs: + full: + # Everything, including the tinydelta integration. + name: Python ${{ matrix.python-version }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: ["3.11", "3.12", "3.13"] + include: + - os: windows-latest + python-version: "3.13" + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml + + - name: Install with the tinydelta extra + run: python -m pip install -e ".[dev,delta]" + + # tests/test_delta.py uses importorskip, so a failed tinydelta install + # would quietly skip eight tests and still report green. Fail loudly. + - name: Require tinydelta + run: python -c "import tinydelta" + + - name: Run tests + run: python -m pytest -q -rs + + no-optional-deps: + # The README promises the CSV path needs nothing beyond the standard + # library. Prove it on every change rather than taking it on trust. + name: No optional dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.13" + cache: pip + cache-dependency-path: pyproject.toml + + - name: Install without extras + run: python -m pip install -e ".[dev]" + + - name: Run tests + run: python -m pytest -q -rs + + - name: Run a query from the command line + run: python -m tinyquery --analyze "SELECT region FROM orders WHERE year = 2024" diff --git a/README.md b/README.md index 677be17..2038ecf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # tinyquery +[![tests](https://github.com/SpookyJumpyBeans/tinyquery/actions/workflows/tests.yml/badge.svg)](https://github.com/SpookyJumpyBeans/tinyquery/actions/workflows/tests.yml) + Single node SQL engine. You write a small subset of SQL, it parses it, builds an iterator plan, and runs it. This is the same shape as Spark/Postgres (parse → plan → operators), on one machine, in memory.