|
| 1 | +name: Reusable Windows Binary Build |
| 2 | +# author: Christoph Froehlich <[email protected]> |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + ros_distro: |
| 8 | + description: 'ROS 2 distribution name. One of |
| 9 | + https://github.com/ros-tooling/setup-ros/blob/master/src/setup-ros-windows.ts' |
| 10 | + required: true |
| 11 | + type: string |
| 12 | + ref_for_scheduled_build: |
| 13 | + description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' |
| 14 | + default: '' |
| 15 | + required: false |
| 16 | + type: string |
| 17 | + os_name: |
| 18 | + description: 'On which OS to run the build job' |
| 19 | + required: false |
| 20 | + default: 'windows-2019' |
| 21 | + type: string |
| 22 | + container: |
| 23 | + description: '(optional) Docker container to run the job in, e.g. ubuntu:noble' |
| 24 | + required: false |
| 25 | + default: '' |
| 26 | + type: string |
| 27 | + |
| 28 | +jobs: |
| 29 | + reusable_ros_tooling_source_build: |
| 30 | + name: ${{ inputs.ros_distro }} ${{ inputs.os_name }} |
| 31 | + runs-on: ${{ inputs.os_name }} |
| 32 | + container: ${{ inputs.container }} |
| 33 | + env: |
| 34 | + # this will be src/{repo-owner}/{repo-name} |
| 35 | + repo_path: src/${{ github.repository }} |
| 36 | + steps: |
| 37 | + - uses: actions/setup-python@v5 |
| 38 | + # setup-ros has hardcoded python 3.8, as it is the default version acc. to REP-2000 for jazzy |
| 39 | + # let's use the same version here for the later action-ros-ci step |
| 40 | + with: |
| 41 | + python-version: '3.8' |
| 42 | + |
| 43 | + - uses: ros-tooling/[email protected] |
| 44 | + with: |
| 45 | + required-ros-distributions: ${{ inputs.ros_distro }} |
| 46 | + use-ros2-testing: true |
| 47 | + |
| 48 | + - name: Checkout default ref when build is not scheduled |
| 49 | + if: ${{ github.event_name != 'schedule' }} |
| 50 | + uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + path: ${{ env.repo_path }} |
| 53 | + - name: Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build |
| 54 | + if: ${{ github.event_name == 'schedule' }} |
| 55 | + uses: actions/checkout@v4 |
| 56 | + with: |
| 57 | + ref: ${{ inputs.ref_for_scheduled_build }} |
| 58 | + path: ${{ env.repo_path }} |
| 59 | + |
| 60 | + - id: package_list_action |
| 61 | + uses: ros-controls/ros2_control_ci/.github/actions/set-package-list@master |
| 62 | + with: |
| 63 | + path: ${{ env.repo_path }} |
| 64 | + |
| 65 | + - name: Check for local repos file |
| 66 | + id: check_local_repos |
| 67 | + run: | |
| 68 | + if (Test-Path ${{ env.repo_path }}/${{ steps.package_list_action.outputs.repo_name }}.${{ inputs.ros_distro }}.repos) { |
| 69 | + Write-Output "Local repos file found" |
| 70 | + "repo_file=${{ env.repo_path }}/${{ steps.package_list_action.outputs.repo_name }}.${{ inputs.ros_distro }}.repos" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append |
| 71 | + } else { |
| 72 | + Write-Output "No local repos file found" |
| 73 | + "repo_file=" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append |
| 74 | + } |
| 75 | +
|
| 76 | + - uses: actions/setup-python@v5 |
| 77 | + with: |
| 78 | + python-version: '3.8' |
| 79 | + |
| 80 | + - uses: ros-tooling/[email protected] |
| 81 | + with: |
| 82 | + target-ros2-distro: ${{ inputs.ros_distro }} |
| 83 | + package-name: ${{ steps.package_list_action.outputs.package_list }} |
| 84 | + vcs-repo-file-url: | |
| 85 | + ${{ steps.check_local_repos.outputs.repo_file }} |
| 86 | + colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml |
| 87 | + colcon-defaults: | |
| 88 | + { |
| 89 | + "test": { |
| 90 | + "executor": "sequential" |
| 91 | + } |
| 92 | + } |
| 93 | + id: action-ros |
| 94 | + |
| 95 | + - name: Download issue template for target failure # Has to be a local file |
| 96 | + if: ${{ always() && steps.action-ros.outcome == 'failure' && github.event_name == 'schedule' }} |
| 97 | + run: |
| 98 | + wget https://raw.githubusercontent.com/ros-controls/ros2_control_ci/master/.github/issue_template_failed_ci.md -O ${{ env.repo_path }}/.github/issue_template_failed_ci.md |
| 99 | + - uses: JasonEtco/create-an-issue@v2 |
| 100 | + # action-ros-ci does not report more details on test failures afaik |
| 101 | + if: ${{ always() && steps.action-ros.outcome == 'failure' && github.event_name == 'schedule'}} |
| 102 | + env: |
| 103 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 104 | + ACTION_NAME: ${{ inputs.ros_distro }}/source |
| 105 | + REF: ${{ inputs.ref_for_scheduled_build }} |
| 106 | + URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 107 | + with: |
| 108 | + update_existing: true |
| 109 | + filename: ${{ env.repo_path }}/.github/issue_template_failed_ci.md |
0 commit comments