Skip to content

generate_rosdep_yaml #1141

generate_rosdep_yaml

generate_rosdep_yaml #1141

name: generate_rosdep_yaml
on:
schedule:
- cron: 0 0 * * *
push:
branches: [ master ]
workflow_dispatch:
jobs:
generate_rosdep_yaml:
name: generate_rosdep_yaml
runs-on: ubuntu-22.04
steps:
- name: basic install
run: |
sudo apt install make ansible
- name: ansible version
run: |
ansible-playbook --version
- name: Setup ROS2 humble environment
uses: ros-tooling/[email protected]
with:
required-ros-distributions: humble
- uses: actions/checkout@v2-beta
- name: run ansible
run: |
ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos_full.yml --connection local --become -e ansible_user=ubuntu
- name: run script
run: |
python3 generate_rosdep_yaml.py ../robotx_ws/src/
working-directory: scripts
- uses: actions/upload-artifact@v2
with:
name: rosdep_yaml
path: scripts/rosdep.yaml
- uses: actions/upload-artifact@v2
with:
name: repos_file
path: ansible/packages.repos
deploy_to_ouxt_distro:
name: deploy_to_ouxt_distro
runs-on: ubuntu-22.04
needs: generate_rosdep_yaml
steps:
- uses: actions/checkout@v2
with:
repository: OUXT-Polaris/ouxt_distro
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
- uses: actions/download-artifact@v2
with:
name: rosdep_yaml
- uses: actions/download-artifact@v2
with:
name: repos_file
- name: Check branch exist
id: check_branch
run: |
echo "::set-output name=exist::$(git ls-remote --heads https://github.com/OUXT-Polaris/ouxt_distro.git deploy | wc -l)"
- name: Count changes
id: changes
run: |
git add -N .
echo "::set-output name=count::$(git diff --name-only | wc -l)"
- name: Check default branch
id: check_default_branch
run: |
echo "::set-output name=default_branch::$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"
- uses: peter-evans/create-pull-request@v3
id: create_pull_request
if: steps.check_branch.outputs.exist == 0 && steps.changes.outputs.count > 0
with:
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
commit-message: Update rosdep.yaml
committer: wam-v-tan <[email protected]>
author: wam-v-tan <[email protected]>
signoff: false
branch: deploy
base: ${{ steps.check_default_branch.outputs.default_branch }}
delete-branch: true
title: '[Bot] Update workflow'
body: |
# Description
Update rosdep.yaml
# How to check
Please check passing all CI test.
labels: |
bot
assignees: wam-v-tan
reviewers: wam-v-tan
team-reviewers: |
owners
maintainers
draft: false
- name: Enable Pull Request Automerge
if: steps.create_pull_request.outputs.pull-request-operation == 'created'
uses: peter-evans/enable-pull-request-automerge@v1
with:
token: ${{ secrets.WAMV_TAN_BOT_SECRET }}
pull-request-number: ${{ steps.create_pull_request.outputs.pull-request-number }}
merge-method: squash
repository: OUXT-Polaris/ouxt_distro