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
  • Loading branch information
stephanie-eng authored Jul 26, 2024
1 parent 80bd8c2 commit 1709ece
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ jobs:
- uses: actions/checkout@v4

- 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 @@ -39,6 +42,7 @@ jobs:
run: |
source /opt/ros/rolling/setup.bash
source /root/ws_moveit/install/setup.bash
source .venv/bin/activate
./htmlproofer.sh
upload_site_artifacts:
Expand All @@ -58,9 +62,12 @@ jobs:
- uses: actions/checkout@v4

- 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 +78,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 1709ece

Please sign in to comment.