diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 502831e788..28585b748f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 @@ -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: @@ -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 @@ -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 diff --git a/doc/how_to_contribute/how_to_contribute_to_site.rst b/doc/how_to_contribute/how_to_contribute_to_site.rst index 65120111e8..992ef3d2d4 100644 --- a/doc/how_to_contribute/how_to_contribute_to_site.rst +++ b/doc/how_to_contribute/how_to_contribute_to_site.rst @@ -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 diff --git a/htmlproofer.sh b/htmlproofer.sh index b8868144d3..ca916ad82a 100755 --- a/htmlproofer.sh +++ b/htmlproofer.sh @@ -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 @@ -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