-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow merge many steps and pre-commit
- Loading branch information
1 parent
f1eed28
commit 5ebff72
Showing
20 changed files
with
344 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,65 @@ | ||
--- | ||
name: Bump version | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: Version to bump (major, minor, patch) | ||
default: patch | ||
required: true | ||
pull_request: | ||
branches: master | ||
types: [closed] | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: Version to bump (major, minor, patch) | ||
default: patch | ||
required: true | ||
pull_request: | ||
branches: master | ||
types: [closed] | ||
|
||
jobs: | ||
industrial_ci: | ||
name: Industrial CI | ||
uses: ./.github/workflows/industrial_ci.yaml | ||
industrial_ci: | ||
name: Industrial CI | ||
uses: ./.github/workflows/industrial_ci.yaml | ||
|
||
get-bump: | ||
get-bump: | ||
name: Get version bump | ||
runs-on: ubuntu-latest | ||
needs: industrial_ci | ||
outputs: | ||
bump: ${{ env.BUMP }} | ||
steps: | ||
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true | ||
name: Get version bump | ||
runs-on: ubuntu-latest | ||
needs: industrial_ci | ||
outputs: | ||
bump: ${{ env.BUMP }} | ||
steps: | ||
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true | ||
name: Get version bump | ||
id: get-version-bump | ||
uses: husarion-ci/action-get-version-bump@v0.3.0 | ||
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true | ||
run: echo "BUMP=${{ steps.get-version-bump.outputs.bump }}" >> $GITHUB_ENV | ||
- if: github.event_name == 'workflow_dispatch' | ||
run: echo "BUMP=${{ github.event.inputs.name }}" >> $GITHUB_ENV | ||
id: get-version-bump | ||
uses: husarion-ci/action-get-version-bump@v0.3.0 | ||
- if: github.event_name == 'pull_request' && github.event.pull_request.merged == true | ||
run: echo "BUMP=${{ steps.get-version-bump.outputs.bump }}" >> $GITHUB_ENV | ||
- if: github.event_name == 'workflow_dispatch' | ||
run: echo "BUMP=${{ github.event.inputs.name }}" >> $GITHUB_ENV | ||
|
||
catkin-release: | ||
name: Bump version | ||
runs-on: ubuntu-latest | ||
needs: get-bump | ||
outputs: | ||
new_version: ${{ steps.catkin-release.outputs.new_version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Catkin release | ||
id: catkin-release | ||
uses: husarion-ci/action-catkin-release@v0.1.4 | ||
with: | ||
bump: ${{ needs.get-bump.outputs.bump }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
git_user: action-bot | ||
git_email: action-bot@action-bot.com | ||
catkin-release: | ||
name: Bump version | ||
runs-on: ubuntu-latest | ||
needs: get-bump | ||
outputs: | ||
new_version: ${{ steps.catkin-release.outputs.new_version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Catkin release | ||
id: catkin-release | ||
uses: husarion-ci/action-catkin-release@v0.1.4 | ||
with: | ||
bump: ${{ needs.get-bump.outputs.bump }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
git_user: action-bot | ||
git_email: action-bot@action-bot.com | ||
|
||
build-and-push-docker-image: | ||
name: Create new docker image | ||
runs-on: ubuntu-latest | ||
needs: catkin-release | ||
steps: | ||
- name: trigger the endpoint | ||
run: > | ||
curl -X POST | ||
-H "Accept: application/vnd.github+json" | ||
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" | ||
https://api.github.com/repos/husarion/rosbot-xl-docker/dispatches | ||
-d '{"event_type":"ros-package-update","client_payload":{"image_version":"${{ needs.catkin-release.outputs.new_version }}"}}' | ||
build-and-push-docker-image: | ||
name: Create new docker image | ||
runs-on: ubuntu-latest | ||
needs: catkin-release | ||
steps: | ||
- name: trigger the endpoint | ||
run: > | ||
curl -X POST | ||
-H "Accept: application/vnd.github+json" | ||
-H "Authorization: Bearer ${{ secrets.GH_PAT }}" | ||
https://api.github.com/repos/husarion/rosbot-xl-docker/dispatches | ||
-d '{"event_type":"ros-package-update","client_payload":{"image_version":"${{ needs.catkin-release.outputs.new_version | ||
}}"}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,60 @@ | ||
--- | ||
name: Industrial CI | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
push: | ||
workflow_call: | ||
workflow_dispatch: | ||
push: | ||
|
||
|
||
jobs: | ||
black: | ||
name: Black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable | ||
with: | ||
options: --line-length=99 | ||
|
||
spellcheck: | ||
black: | ||
name: Black | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: psf/black@stable | ||
with: | ||
options: --line-length=99 | ||
|
||
spellcheck: | ||
name: Spellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: rojopolis/spellcheck-github-actions@0.33.1 | ||
name: Spellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: rojopolis/spellcheck-github-actions@0.33.1 | ||
name: Spellcheck | ||
|
||
ros_industrial_ci: | ||
name: ROS Industrial CI | ||
needs: | ||
- black | ||
- spellcheck | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ROS_DISTRO: [humble] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Copy to src | ||
run: | | ||
mkdir -p src | ||
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \; | ||
- name: Clone installation requirements | ||
shell: bash | ||
run: | | ||
python3 -m pip install -U vcstool | ||
vcs import src < src/rosbot_xl/rosbot_xl_hardware.repos | ||
vcs import src < src/rosbot_xl/rosbot_xl_simulation.repos | ||
- name: Copy only diff_drive_controller and imu_sensor_broadcaster, waits for features from ros2-control | ||
shell: bash | ||
run: | | ||
cp -r src/ros2_controllers/diff_drive_controller src/ | ||
cp -r src/ros2_controllers/imu_sensor_broadcaster src/ | ||
rm -rf src/ros2_controllers | ||
- name: Copy only tf2_ros_py from geometry2, waits for https://github.com/ros2/geometry2/pull/641 | ||
shell: bash | ||
run: | | ||
cp -r src/geometry2/tf2_ros_py src/ | ||
rm -rf src/geometry2/ | ||
- name: Remove ign_ros2_control demo | ||
shell: bash | ||
run: | | ||
rm -rf src/gazebosim/gz_ros2_control/ign_ros2_control_demos && | ||
rm -rf src/gazebosim/gz_ros2_control/gz_ros2_control_tests | ||
|
||
- uses: ros-industrial/industrial_ci@master | ||
env: | ||
ROS_DISTRO: ${{matrix.ROS_DISTRO}} | ||
HUSARION_ROS_BUILD: simulation | ||
ros_industrial_ci: | ||
name: ROS Industrial CI | ||
needs: | ||
- black | ||
- spellcheck | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ROS_DISTRO: [humble] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup ROS2 Workspace and Clone Repositories | ||
run: | | ||
mkdir -p src | ||
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \; | ||
python3 -m pip install -U vcstool | ||
vcs import src < src/rosbot_xl/rosbot_xl_hardware.repos | ||
vcs import src < src/rosbot_xl/rosbot_xl_simulation.repos | ||
cp -r src/ros2_controllers/diff_drive_controller src/ | ||
cp -r src/ros2_controllers/imu_sensor_broadcaster src/ | ||
rm -rf src/ros2_controllers | ||
cp -r src/geometry2/tf2_ros_py src/ | ||
rm -rf src/geometry2/ | ||
rm -rf src/gazebosim/gz_ros2_control/ign_ros2_control_demos | ||
rm -rf src/gazebosim/gz_ros2_control/gz_ros2_control_tests | ||
- uses: ros-industrial/industrial_ci@master | ||
env: | ||
ROS_DISTRO: ${{matrix.ROS_DISTRO}} | ||
HUSARION_ROS_BUILD: simulation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.