Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create usable workflows #125

Merged
merged 16 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from 15 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
27 changes: 27 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Install Dependencies"
description: "Python dependencies"

runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
with:
repository: christophfroehlich/control.ros.org
ref: reusable_wf
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
shell: bash
- name: Install generate_parameter_library
run: |
cd
git clone https://github.com/PickNikRobotics/generate_parameter_library.git
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
34 changes: 34 additions & 0 deletions .github/workflows/reusable-sphinx-check-single-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Reusable workflow to check a single version"
on:
workflow_call:
inputs:
ROS2_CONTROL_PR:
type: string
ROS2_CONTROLLERS_PR:
type: string
ROS2_CONTROL_DEMOS_PR:
type: string
GAZEBO_ROS2_CONTROL_PR:
type: string
GZ_ROS2_CONTROL_PR:
type: string

jobs:
build-single-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: christophfroehlich/control.ros.org
ref: reusable_wf
fetch-depth: 0
- name: Install dependencies
uses: christophfroehlich/control.ros.org/.github/actions/install-dependencies@reusable_wf
- name: Build single version with optional PRs' numbers considering warnings as errors
env:
ROS2_CONTROL_PR: ${{ inputs.ROS2_CONTROL_PR }}
ROS2_CONTROLLERS_PR: ${{ inputs.ROS2_CONTROLLERS_PR }}
ROS2_CONTROL_DEMOS_PR: ${{ inputs.ROS2_CONTROL_DEMOS_PR }}
GAZEBO_ROS2_CONTROL_PR: ${{ inputs.GAZEBO_ROS2_CONTROL_PR }}
GZ_ROS2_CONTROL_PR: ${{ inputs.GZ_ROS2_CONTROL_PR }}
run: make html-all-subrepos-with-errors
20 changes: 4 additions & 16 deletions .github/workflows/sphinx-check-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,17 @@ on:
schedule:
# Run every morning to ensure component documentation is up to date on deployment
- cron: '23 5 * * *'
pull_request: # only runs up through build of sphinx
pull_request:

jobs:
build-deploy:
build-halt-on-errors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
- name: Install generate_parameter_library
run: |
cd
git clone https://github.com/PickNikRobotics/generate_parameter_library.git
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Build multiversion considering warnings as errors
run: |
git config --local user.email "[email protected]"
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/sphinx-make-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.8'
cache: 'pip'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --requirement requirements.txt
- name: Install generate_parameter_library
run: |
cd
git clone https://github.com/PickNikRobotics/generate_parameter_library.git
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Install doxygen and graphviz
run: sudo apt-get install -y doxygen graphviz
- name: Build multiversion with API
Expand Down
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ help:
@$(SPHINXBUILD) -M help $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS) $(O)
@echo " html-with-api"
@echo " html-all-subrepos"
@echo " html-all-subrepos-with-errors"
@echo " html-all-subrepos-with-api"
@echo " multiversion"
@echo " multiversion-with-api"
@echo " multiversion-with-errors"

html-with-api: Makefile
@echo Single html file with API
Expand All @@ -33,6 +35,15 @@ html-all-subrepos: Makefile
@echo Step 3: Deleting subrepositories in doc/ folder
./make_help_scripts/delete_sub_repos

html-all-subrepos-with-errors: Makefile
@echo Single html file without API
@echo Step 1: Cloning all subrepositories
./make_help_scripts/add_sub_repos
@echo Step 2: Building documentation
$(SPHINXBUILD) $(SPHINXOPTS) -W --keep-going $(SOURCEDIR) $(BUILDDIR)/html
@echo Step 3: Deleting subrepositories in doc/ folder
./make_help_scripts/delete_sub_repos

html-all-subrepos-with-api: Makefile
@echo Single html file with API
@echo Step 1: Cloning all subrepositories
Expand Down Expand Up @@ -79,7 +90,7 @@ multiversion-with-api: Makefile
@echo Step 5: Create correct index
@echo "<html><head><meta http-equiv=\"refresh\" content=\"0; url=master/index.html\" /></head></html>" > "$(BUILDDIR)"/html/index.html

.PHONY: help Makefile html-with-api multiversion multiversion-with-api html-all-subrepos html-all-subrepos-with-api
.PHONY: help Makefile html-with-api multiversion multiversion-with-api multiversion-with-errors html-all-subrepos html-all-subrepos-with-api html-all-subrepos-with-errors

# TODO(denis): Enable this!
# # # # Generate the doxygen xml (for Sphinx) and copy the doxygen html to the
Expand Down
11 changes: 9 additions & 2 deletions make_help_scripts/add_sub_repos
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ add_sub_repositories () {
# checkout a base for defined starting point
cd "$base_dir" || { echo "Could not checkout base dir of control.ros.org. Exiting!"; exit "$ERRCODE"; }
for repo_name in "${!subrepo_url[@]}";
do echo "Create doc/$repo_name";
git clone "${subrepo_url[$repo_name]}" -b "$api_branch" doc/"$repo_name"
do echo "Create doc/$repo_name"
git clone "${subrepo_url[$repo_name]}" -b master doc/"$repo_name"
if [ ! -z ${subrepo_pr[$repo_name]} ]; then
echo "checkout PR: ${subrepo_pr[$repo_name]}"
cd doc/"$repo_name"
git fetch origin ${subrepo_pr[$repo_name]}:PR
git checkout PR
cd "$base_dir"
fi
done
}

Expand Down
4 changes: 3 additions & 1 deletion make_help_scripts/deploy_defines
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ api_branch="master"
# branches on which the temporary commits are created and which branch should be checked out in the subrepositories
# ["branch checked out for mutliversion"]="branch checked out for all subrepos"
declare -A branch_version=( ["foxy"]="foxy" ["galactic"]="galactic" ["humble"]="humble" ["master"]="master") # master is rolling
# the subrepos which are cloned into the branches and their corresponding url

# the subrepos which are cloned into the branches and, optionally, their corresponding PR for checkout
declare -A subrepo_url=( ["ros2_control"]="https://github.com/ros-controls/ros2_control" ["ros2_controllers"]="https://github.com/ros-controls/ros2_controllers" ["ros2_control_demos"]="https://github.com/ros-controls/ros2_control_demos" ["gazebo_ros2_control"]="https://github.com/ros-controls/gazebo_ros2_control" ["gz_ros2_control"]="https://github.com/ros-controls/gz_ros2_control")
declare -A subrepo_pr=( ["ros2_control"]=$ROS2_CONTROL_PR ["ros2_controllers"]=$ROS2_CONTROLLERS_PR ["ros2_control_demos"]=$ROS2_CONTROL_DEMOS_PR ["gazebo_ros2_control"]=$GAZEBO_ROS2_CONTROL_PR ["gz_ros2_control"]=$GZ_ROS2_CONTROL_PR)