|
48 | 48 | uv run --no-project ruff check --output-format=github python/ |
49 | 49 | uv run --no-project ruff format --check python/ |
50 | 50 |
|
| 51 | + - name: Run codespell |
| 52 | + run: | |
| 53 | + uv run --no-project codespell --toml pyproject.toml |
| 54 | +
|
51 | 55 | generate-license: |
52 | 56 | runs-on: ubuntu-latest |
53 | 57 | steps: |
@@ -271,7 +275,100 @@ jobs: |
271 | 275 | with: |
272 | 276 | name: dist |
273 | 277 | pattern: dist-* |
274 | | - |
| 278 | + |
| 279 | + # Documentation build job that runs after wheels are built |
| 280 | + build-docs: |
| 281 | + name: Build docs |
| 282 | + runs-on: ubuntu-latest |
| 283 | + needs: [build-manylinux-x86_64] # Only need the Linux wheel for docs |
| 284 | + # Only run docs on main branch pushes, tags, or PRs |
| 285 | + if: github.event_name == 'push' || github.event_name == 'pull_request' |
| 286 | + steps: |
| 287 | + - name: Set target branch |
| 288 | + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') |
| 289 | + id: target-branch |
| 290 | + run: | |
| 291 | + set -x |
| 292 | + if test '${{ github.ref }}' = 'refs/heads/main'; then |
| 293 | + echo "value=asf-staging" >> "$GITHUB_OUTPUT" |
| 294 | + elif test '${{ github.ref_type }}' = 'tag'; then |
| 295 | + echo "value=asf-site" >> "$GITHUB_OUTPUT" |
| 296 | + else |
| 297 | + echo "Unsupported input: ${{ github.ref }} / ${{ github.ref_type }}" |
| 298 | + exit 1 |
| 299 | + fi |
| 300 | +
|
| 301 | + - name: Checkout docs sources |
| 302 | + uses: actions/checkout@v5 |
| 303 | + |
| 304 | + - name: Checkout docs target branch |
| 305 | + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') |
| 306 | + uses: actions/checkout@v5 |
| 307 | + with: |
| 308 | + fetch-depth: 0 |
| 309 | + ref: ${{ steps.target-branch.outputs.value }} |
| 310 | + path: docs-target |
| 311 | + |
| 312 | + - name: Setup Python |
| 313 | + uses: actions/setup-python@v5 |
| 314 | + with: |
| 315 | + python-version: "3.11" |
| 316 | + |
| 317 | + - name: Install dependencies |
| 318 | + uses: astral-sh/setup-uv@v6 |
| 319 | + with: |
| 320 | + enable-cache: true |
| 321 | + |
| 322 | + # Download the Linux wheel built in the previous job |
| 323 | + - name: Download pre-built Linux wheel |
| 324 | + uses: actions/download-artifact@v5 |
| 325 | + with: |
| 326 | + name: dist-manylinux-x86_64 |
| 327 | + path: wheels/ |
| 328 | + |
| 329 | + # Install from the pre-built wheel |
| 330 | + - name: Install from pre-built wheel |
| 331 | + run: | |
| 332 | + set -x |
| 333 | + uv venv |
| 334 | + # Install documentation dependencies |
| 335 | + uv sync --dev --no-install-package datafusion --group docs |
| 336 | + # Install the pre-built wheel |
| 337 | + WHEEL=$(find wheels/ -name "*.whl" | head -1) |
| 338 | + if [ -n "$WHEEL" ]; then |
| 339 | + echo "Installing wheel: $WHEEL" |
| 340 | + uv pip install "$WHEEL" |
| 341 | + else |
| 342 | + echo "ERROR: No wheel found!" |
| 343 | + exit 1 |
| 344 | + fi |
| 345 | +
|
| 346 | + - name: Build docs |
| 347 | + run: | |
| 348 | + set -x |
| 349 | + cd docs |
| 350 | + curl -O https://gist.githubusercontent.com/ritchie46/cac6b337ea52281aa23c049250a4ff03/raw/89a957ff3919d90e6ef2d34235e6bf22304f3366/pokemon.csv |
| 351 | + curl -O https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2021-01.parquet |
| 352 | + uv run --no-project make html |
| 353 | +
|
| 354 | + - name: Copy & push the generated HTML |
| 355 | + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') |
| 356 | + run: | |
| 357 | + set -x |
| 358 | + cd docs-target |
| 359 | + # delete anything but: 1) '.'; 2) '..'; 3) .git/ |
| 360 | + find ./ | grep -vE "^./$|^../$|^./.git" | xargs rm -rf |
| 361 | + cp ../.asf.yaml . |
| 362 | + cp -r ../docs/build/html/* . |
| 363 | + git status --porcelain |
| 364 | + if [ "$(git status --porcelain)" != "" ]; then |
| 365 | + git config user.name "github-actions[bot]" |
| 366 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 367 | + git add --all |
| 368 | + git commit -m 'Publish built docs triggered by ${{ github.sha }}' |
| 369 | + git push || git push --force |
| 370 | + fi |
| 371 | +
|
275 | 372 | # NOTE: PyPI publish needs to be done manually for now after release passed the vote |
276 | 373 | # release: |
277 | 374 | # name: Publish in PyPI |
|
0 commit comments