Skip to content

Commit

Permalink
Use venv in CI (#916)
Browse files Browse the repository at this point in the history
* Use venv in CI

* Update htmlproofer instructions

* Add a comment about venv

* Reference which script "the script" means

* Format

(cherry picked from commit 1709ece)

# Conflicts:
#	.github/workflows/deploy.yml
  • Loading branch information
stephanie-eng authored and mergify[bot] committed Nov 17, 2024
1 parent 3e65764 commit bf822e5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@ jobs:
cache: 'pip'

- name: Install Python dependencies
shell: bash
run: |
<<<<<<< HEAD
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
=======
sudo apt-get update -y
sudo apt-get install -y python3-pip python3-venv
python3 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade --requirement requirements.txt
>>>>>>> 1709ece (Use venv in CI (#916))

- name: Install doxygen and graphviz
run: sudo apt-get install -y doxygen graphviz
Expand All @@ -37,7 +46,16 @@ jobs:
ruby-version: '3'

- name: Run htmlproofer.sh
<<<<<<< HEAD
run: ./htmlproofer.sh
=======
shell: bash
run: |
source /opt/ros/rolling/setup.bash
source /root/ws_moveit/install/setup.bash
source .venv/bin/activate
./htmlproofer.sh
>>>>>>> 1709ece (Use venv in CI (#916))

upload_site_artifacts:
strategy:
Expand All @@ -58,9 +76,12 @@ jobs:
ref: 'main'

- name: Install Python dependencies
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y python3-pip
sudo apt-get install -y python3-pip python3-venv
python3 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade --requirement requirements.txt
- name: Install doxygen and graphviz
Expand All @@ -71,6 +92,7 @@ jobs:
run: |
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
source /root/ws_moveit/install/setup.bash
source .venv/bin/activate
make generate_api_artifacts BRANCH=${{ matrix.branch }}
- name: Compress Artifact
Expand Down
15 changes: 14 additions & 1 deletion doc/how_to_contribute/how_to_contribute_to_site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,20 @@ Steps
2. Test for broken links

To test for broken links run this command:
To test for broken links, run the ``htmlproofer`` script. Note that running this script may require you to install some Python dependencies. If using ``pip`` to install these dependencies, you may want to create a virtual environment.

.. code-block:: bash
python3 -m venv .venv
source .venv/bin/activate
You can then install requirements using ``pip``:

.. code-block:: bash
pip3 install --upgrade --requirement requirements.txt
You can run the ``htmlproofer`` script with this command:

.. code-block:: bash
Expand Down
3 changes: 2 additions & 1 deletion htmlproofer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Note that a virtual environment is required when running this script in CI
set -e

# Define some config vars
Expand All @@ -12,7 +13,7 @@ gem install --user-install html-proofer -v 3.19.4 # newer 4.x requires different
PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH"

# Install python dependencies
pip3 install --user --upgrade -r requirements.txt
pip3 install --upgrade -r requirements.txt

# Clear out any previous builds
rm -rf build
Expand Down

0 comments on commit bf822e5

Please sign in to comment.