diff --git a/.github/workflows/check_docs_build.yml b/.github/workflows/check_docs_build.yml new file mode 100644 index 000000000..55635f610 --- /dev/null +++ b/.github/workflows/check_docs_build.yml @@ -0,0 +1,40 @@ +name: ci + +on: + pull_request: + push: + branches: [main] + +jobs: + mkdocs: + strategy: + matrix: + python-version: ["3.11"] + os: [ubuntu-latest] + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Cache multiple paths + uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + $RUNNER_TOOL_CACHE/Python/* + ~\AppData\Local\pip\Cache + key: ${{ runner.os }}-build-${{ matrix.python-version }} + - name: install-reqs + run: python -m pip install --upgrade tox virtualenv setuptools pip -r requirements-dev.txt + - name: install-docs-reqs + run: python -m pip install --upgrade -r docs/requirements-docs.txt + - name: local-install + run: python -m pip install -e . + - name: check-no-errors + run: python -m mkdocs build > output.txt 2>&1 + - name: assert-no-errors + run: python utils/check_for_no_build_errors.py + - name: strict-docs-build + run: mkdocs build --strict diff --git a/docs/levels.md b/docs/levels.md index d632baa6d..bfa580f1a 100644 --- a/docs/levels.md +++ b/docs/levels.md @@ -28,6 +28,8 @@ level of support. If a library implements the a call such as ```python exec="1" source="above" +from typing import Any + import narwhals as nw from narwhals.schema import Schema diff --git a/tests/frame/join_test.py b/tests/frame/join_test.py index f8cafbdf5..9ba119916 100644 --- a/tests/frame/join_test.py +++ b/tests/frame/join_test.py @@ -154,7 +154,7 @@ def test_left_join_multiple_column(request: Any, constructor: Any) -> None: compare_dicts(result, expected) -@pytest.mark.filterwarnings("ignore: the defaultcoalesce behavior") +@pytest.mark.filterwarnings("ignore: the default coalesce behavior") def test_left_join_overlapping_column(request: Any, constructor: Any) -> None: if "pyarrow_table" in str(constructor): request.applymarker(pytest.mark.xfail) diff --git a/utils/check_for_no_build_errors.py b/utils/check_for_no_build_errors.py new file mode 100644 index 000000000..995411e9d --- /dev/null +++ b/utils/check_for_no_build_errors.py @@ -0,0 +1,15 @@ +""" +Check that `output.txt` doesn't contain the string +"exited with errors". If it does, exit with status 1. + +This is just used in CI. +""" + +import sys + +with open("output.txt") as fd: + content = fd.read() + +if "exited with errors" in content: + sys.exit(1) +sys.exit(0)