Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 26 additions & 28 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
pull_request:
branches: [ main, develop ]
workflow_dispatch:
inputs:
deploy_docs:
description: Build and deploy the documentation without publishing to PyPI
required: true
default: false
type: boolean

jobs:

Expand Down Expand Up @@ -93,49 +99,38 @@ jobs:

deploy-docs:
needs: test
# only on pushes tagged with v...
if: startsWith(github.ref, 'refs/tags/v')
# Run for releases or when explicitly requested from the Actions UI.
if: >-
startsWith(github.ref, 'refs/tags/v') ||
(github.event_name == 'workflow_dispatch' && inputs.deploy_docs)
runs-on: ubuntu-latest
environment: asim
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
- name: Install uv and set Python 3.10
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
version: "0.12.2"
python-version: "3.10"
enable-cache: true
- name: Install dependencies
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
environment-file: envs/testing.yml
python-version: "3.10"
activate-environment: testing-env
auto-activate-base: false
auto-update-conda: false
- name: Install Jupyterbook and ruamel.yaml
run: |
# The docs use the Jupyter Book 1.x Sphinx project layout.
conda install "jupyter-book<2" ruamel.yaml sphinx-autosummary-accessors -c conda-forge
- name: Install sharrow
run: |
python -m pip install --no-deps .
- name: Conda checkup
run: |
conda info -a
conda list
- name: Install pip build
uv sync --locked --dev
- name: UV checkup
run: |
python -m pip install --upgrade build
uv --version
uv run --locked python --version
uv pip list
- name: Build wheel
run: |
python -m build
uv build
- name: Build the docs
run: |
python docs/_script/run_all.py
jupyter-book build ./docs
uv run --locked --with-requirements docs/requirements.txt python docs/_script/run_all.py
uv run --locked --with-requirements docs/requirements.txt jupyter-book build ./docs
- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v3.5.9
with:
Expand All @@ -145,7 +140,10 @@ jobs:
# now send to PyPI
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.repository_owner == 'ActivitySim'
if: >-
github.event_name == 'push' &&
github.repository_owner == 'ActivitySim' &&
startsWith(github.ref, 'refs/tags/v')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
jupyter-book < 2
ruamel.yaml
matplotlib
numpy >= 1.19
pandas >= 1.2
Expand Down
Loading