Skip to content

Commit

Permalink
Create CI issue only when failing to build / test (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmauch authored Mar 4, 2024
1 parent cd3492e commit 1758da1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/issue_template_failed_ci_downstream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: CI build job {{ env.ACTION_NAME }} failed on downstream workspace
labels: CI
---
An automated scheduled build failed on `{{ env.REF }}`: {{ env.URL }} while building or testing the
downstream workspace. This could be the result of a change in this repo breaking things downstream
or an error caused because of downstream changes.
22 changes: 19 additions & 3 deletions .github/workflows/reusable-industrial-ci-with-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,36 @@ jobs:
OS_CODE_NAME: ${{ inputs.os_code_name }}
BEFORE_INSTALL_UPSTREAM_DEPENDENCIES: ${{ inputs.before_install_upstream_dependencies }}
id: ici
- name: Download issue template # Has to be a local file
- name: Download issue template for target failure # Has to be a local file
if: ${{ always() && steps.ici.outcome == 'failure' && github.event_name == 'schedule' }}
run:
wget https://raw.githubusercontent.com/ros-controls/ros2_control_ci/master/.github/issue_template_failed_ci.md -O .github/issue_template_failed_ci.md
- uses: JasonEtco/create-an-issue@v2
- name: Download issue template for downstream failure # Has to be a local file
if: ${{ always() && steps.ici.outcome == 'failure' && github.event_name == 'schedule' }}
run:
wget https://raw.githubusercontent.com/ros-controls/ros2_control_ci/master/.github/issue_template_failed_ci_downstream.md -O .github/issue_template_failed_ci_downstream.md
- uses: JasonEtco/create-an-issue@v2
# `make` and so `colcon build` returns 2 on errors, while `colcon test-result` returns 1 on
# when any test failed.
if: ${{ always() && (steps.ici.outputs.build_target_workspace == '2' || steps.ici.outputs.target_test_results == '1') && github.event_name == 'schedule'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTION_NAME: ${{ inputs.ros_distro }}/${{ inputs.ros_repo }}
REF: ${{ inputs.ref_for_scheduled_build }}
URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/issue_template_failed_ci.md
- uses: JasonEtco/create-an-issue@v2
if: ${{ always() && (steps.ici.outputs.build_downstream_workspace == '2' || steps.ici.outputs.downstream_test_results == '1') && github.event_name == 'schedule'}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTION_NAME: ${{ inputs.ros_distro }}/${{ inputs.ros_repo }}
REF: ${{ inputs.ref_for_scheduled_build }}
URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/issue_template_failed_ci.md
filename: .github/issue_template_failed_ci_downstream.md
- name: prepare target_ws for cache
if: ${{ always() && ! matrix.env.CCOV }}
run: |
Expand Down

0 comments on commit 1758da1

Please sign in to comment.