Parallelize pyodide based docs #407
Workflow file for this run
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
# things not included | |
# language | |
# notifications - no email notifications set up | |
name: tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
workflow_dispatch: | |
schedule: | |
- cron: '0 20 * * SUN' | |
jobs: | |
pre_commit: | |
name: Run pre-commit hooks | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "1" | |
- name: set PY | |
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: pre-commit | |
uses: pre-commit/[email protected] | |
test_suite: | |
name: Test on ${{ matrix.python-version }}, ${{ matrix.os }} | |
needs: [pre_commit] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ['ubuntu-latest'] | |
python-version: ['3.9', '3.10', '3.11'] | |
timeout-minutes: 30 | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: "100" | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Fetch | |
run: git fetch --prune --tags | |
- name: env setup | |
run: | | |
set -xe | |
python -VV | |
python -m site | |
python -m pip install --upgrade pip | |
python -m pip install toml | |
python -m pip install pyctdev | |
doit ecosystem_setup | |
- name: doit develop_install | |
run: doit develop_install -o tests | |
- name: env_capture | |
run: doit env_capture | |
- name: tests | |
run: doit test_unit | |
build_docs: | |
name: Documentation | |
needs: [pre_commit] | |
runs-on: 'ubuntu-latest' | |
timeout-minutes: 120 | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
DESC: "Documentation build" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Fetch unshallow | |
run: git fetch --prune --tags --unshallow -f | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: set up env | |
run: | | |
cd site | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install -r requirements.txt | |
- name: build docs | |
run: | | |
cd site | |
source .venv/bin/activate | |
doit all_build | |
- name: Deploy dev | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
personal_token: ${{ secrets.ACCESS_TOKEN }} | |
external_repository: pyviz-dev/nbsite-dev | |
publish_dir: ./site/builtdocs | |
force_orphan: true | |
- name: clean up | |
run: | | |
cd site | |
source .venv/bin/activate | |
doit clean --clean-dep all_build | |
- name: check no leftover | |
run: git diff --quiet || exit 1 |