-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci[rust,python]: Improve docs workflows (#4806)
- Loading branch information
Showing
2 changed files
with
35 additions
and
22 deletions.
There are no files selected for viewing
14 changes: 8 additions & 6 deletions
14
.github/workflows/docs_check.yaml → .github/workflows/docs-check.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
name: Docs check | ||
name: Check documentation | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'py-polars/**' | ||
- '.github/workflows/docs_check.yaml' | ||
- '.github/workflows/docs-check.yaml' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Docs check | ||
main: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: py-polars/docs | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
cache-dependency-path: 'py-polars/docs/requirements-docs.txt' | ||
- name: Install dependencies | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements-docs.txt | ||
- name: Build Python reference | ||
- name: Build Python documentation | ||
env: | ||
SPHINXOPTS: -W | ||
run: make html |
43 changes: 27 additions & 16 deletions
43
.github/workflows/docs.yaml → .github/workflows/docs-deploy.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,55 @@ | ||
name: Docs | ||
name: Deploy documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- docs | ||
|
||
jobs: | ||
test: | ||
name: Docs | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2022-08-22 | ||
components: rust-docs | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
cache-dependency-path: 'py-polars/docs/requirements-docs.txt' | ||
- name: Install dependencies | ||
|
||
- name: Install Python dependencies | ||
working-directory: py-polars/docs | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements-docs.txt | ||
- name: Build python reference | ||
- name: Build Python documentation | ||
working-directory: py-polars/docs | ||
run: make html | ||
- name: deploy docs | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly-2022-08-22 | ||
components: rust-docs | ||
|
||
- name: Cache Rust | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Build Rust documentation | ||
env: | ||
RUSTFLAGS: --cfg docsrs | ||
run: cargo doc --features=docs-selection --package polars | ||
|
||
- name: Prepare deployment | ||
run: | | ||
set -e | ||
cargo doc --features=docs-selection --package polars && \ | ||
echo '<meta http-equiv=refresh content=0;url=polars/index.html>' > target/doc/index.html && \ | ||
echo '<meta http-equiv=refresh content=0;url=polars/index.html>' > target/doc/index.html | ||
mkdir target/doc/py-polars | ||
cp -r py-polars/docs/build/html target/doc/py-polars | ||
echo ghp-import step | ||
ghp-import -n target/doc && \ | ||
- name: Deploy | ||
run: | | ||
ghp-import -n target/doc | ||
git push -qf https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git gh-pages |