tests #448
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 | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: holoviz-dev/holoviz_tasks/pre-commit@v0 | |
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', '3.12'] | |
timeout-minutes: 30 | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: "100" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Fetch | |
run: git fetch --prune --tags | |
- name: env setup | |
run: | | |
set -xe | |
python -VV | |
python -m pip install --upgrade pip | |
python -m pip install -e ".[tests]" | |
- name: pip list | |
run: pip list | |
- name: tests | |
run: pytest nbsite | |
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@v4 | |
- name: Fetch unshallow | |
run: git fetch --prune --tags --unshallow -f | |
- uses: actions/setup-python@v5 | |
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@v4 | |
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 |