Skip to content

Commit

Permalink
Create usable workflows (#125)
Browse files Browse the repository at this point in the history
* Create usable workflow for dependencies

* Checkout repository before git config --local

* Single job only

* Use checkout

* Try composite action

* Optionally checkout PR instead of master branch

* Update comment

* Add reusable workflow for single version

* Fix repository for checkout action

* Fix repository for checkout action

* Fix repository+ref for checkout action

* try to fix source of action

* Add fetch-depth again

* Use correct head info

* Halt on errors

* use master branch ref

Co-authored-by: Christoph Fröhlich <[email protected]>

---------

Co-authored-by: Bence Magyar <[email protected]>
(cherry picked from commit e2a04ea)

# Conflicts:
#	.github/workflows/reusable-sphinx-check-single-version.yml
#	.github/workflows/sphinx-check-links.yml
#	.github/workflows/sphinx-check-warnings.yml
#	Makefile
#	make_help_scripts/deploy_defines
  • Loading branch information
christophfroehlich authored and mergify[bot] committed Aug 12, 2023
1 parent 23fee77 commit 0562dd8
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 2 deletions.
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: ros-controls/control.ros.org
ref: master
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
5 changes: 5 additions & 0 deletions .github/workflows/reusable-sphinx-check-single-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
repository: ros-controls/control.ros.org
ref: master
fetch-depth: 0
<<<<<<< HEAD
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -38,6 +39,10 @@ jobs:
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
=======
- name: Install dependencies
uses: ros-controls/control.ros.org/.github/actions/install-dependencies@master
>>>>>>> e2a04ea (Create usable workflows (#125))
- name: Build single version with optional PRs' numbers considering warnings as errors
env:
ROS2_CONTROL_PR: ${{ inputs.ROS2_CONTROL_PR }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/sphinx-check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
<<<<<<< HEAD:.github/workflows/sphinx-check-links.yml
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -32,6 +33,10 @@ jobs:
cd generate_parameter_library/generate_parameter_library_py/
python -m pip install .
shell: bash
=======
- name: Install dependencies
uses: ./.github/actions/install-dependencies
>>>>>>> e2a04ea (Create usable workflows (#125)):.github/workflows/sphinx-make-page.yml
- name: Install doxygen and graphviz
run: sudo apt-get install -y doxygen graphviz
- name: Build page with API and run linkchecker
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/sphinx-check-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ on:
schedule:
# Run every morning to ensure component documentation is up to date on deployment
- cron: '23 5 * * *'
<<<<<<< HEAD

jobs:
build-halt-on-warnings:
=======
pull_request:

jobs:
build-halt-on-errors:
>>>>>>> e2a04ea (Create usable workflows (#125))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
<<<<<<< HEAD
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -32,6 +40,11 @@ jobs:
python -m pip install .
shell: bash
- name: Build single version considering warnings as errors
=======
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Build multiversion considering warnings as errors
>>>>>>> e2a04ea (Create usable workflows (#125))
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ help:
@echo " multiversion"
@echo " multiversion-with-api"
@echo " multiversion-with-errors"
<<<<<<< HEAD
@echo " linkcheck-all-subrepos-with-api"
=======
>>>>>>> e2a04ea (Create usable workflows (#125))

html-with-api: Makefile
@echo Single html file with API
Expand Down Expand Up @@ -104,7 +107,11 @@ 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

<<<<<<< HEAD
.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 linkcheck-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
>>>>>>> e2a04ea (Create usable workflows (#125))

# 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
7 changes: 7 additions & 0 deletions make_help_scripts/deploy_defines
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ api_branch="master"
# definitions for multiversion
# 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"
<<<<<<< HEAD
declare -A branch_version=( ["foxy"]="foxy" ["galactic"]="galactic" ["master"]="master") # master is rolling
# the subrepos which are cloned into the branches and their corresponding url
=======
declare -A branch_version=( ["foxy"]="foxy" ["galactic"]="galactic" ["humble"]="humble" ["master"]="master") # master is rolling

# the subrepos which are cloned into the branches and, optionally, their corresponding PR for checkout
>>>>>>> e2a04ea (Create usable workflows (#125))
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)

0 comments on commit 0562dd8

Please sign in to comment.