|
| 1 | +name: Reusable industrial_ci workflow |
| 2 | +# original author: Denis Štogl <[email protected]> |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + ref_for_scheduled_build: |
| 8 | + description: 'Reference on which the repo should be checkout for scheduled build. Usually is this name of a branch or a tag.' |
| 9 | + default: '' |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + |
| 13 | + upstream_workspace: |
| 14 | + description: 'UPSTREAM_WORKSPACE variable for industrial_ci. Usually path to local .repos file.' |
| 15 | + required: false |
| 16 | + default: '' |
| 17 | + type: string |
| 18 | + ros_distro: |
| 19 | + description: 'ROS_DISTRO variable for industrial_ci' |
| 20 | + required: true |
| 21 | + type: string |
| 22 | + ros_repo: |
| 23 | + description: 'ROS_REPO to run for industrial_ci. Possible values: "main", "testing"' |
| 24 | + default: 'main' |
| 25 | + required: false |
| 26 | + type: string |
| 27 | + before_install_upstream_dependencies: |
| 28 | + description: 'BEFORE_INSTALL_UPSTREAM_DEPENDENCIES variable for industrial_ci' |
| 29 | + default: '' |
| 30 | + required: false |
| 31 | + type: string |
| 32 | + ccache_dir: |
| 33 | + description: 'CCache dir that should be used. Relative to github.workspace' |
| 34 | + default: '.ccache' |
| 35 | + required: false |
| 36 | + type: string |
| 37 | + |
| 38 | +jobs: |
| 39 | + reusable_ici: |
| 40 | + name: ${{ inputs.ros_distro }} ${{ inputs.ros_repo }} |
| 41 | + runs-on: ubuntu-latest |
| 42 | + env: |
| 43 | + DOCKER_RUN_OPTS: '-v /var/run/docker.sock:/var/run/docker.sock --network ursim_net' |
| 44 | + CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }} |
| 45 | + CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.upstream_workspace }}-${{ inputs.ros_repo }} |
| 46 | + steps: |
| 47 | + - name: Checkout ${{ github.ref_name }} since build is not scheduled |
| 48 | + if: ${{ github.event_name != 'schedule' }} |
| 49 | + uses: actions/checkout@v5 |
| 50 | + - name: Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build |
| 51 | + if: ${{ github.event_name == 'schedule' }} |
| 52 | + uses: actions/checkout@v5 |
| 53 | + with: |
| 54 | + ref: ${{ inputs.ref_for_scheduled_build }} |
| 55 | + - run: docker network create --subnet=192.168.56.0/24 ursim_net |
| 56 | + if: ${{ !env.ACT }} |
| 57 | + - name: Cache ccache |
| 58 | + uses: actions/cache@v4 |
| 59 | + with: |
| 60 | + path: ${{ env.CCACHE_DIR }} |
| 61 | + key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} |
| 62 | + restore-keys: | |
| 63 | + ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} |
| 64 | + ccache-${{ env.CACHE_PREFIX }} |
| 65 | + - uses: 'ros-industrial/industrial_ci@master' |
| 66 | + env: |
| 67 | + UPSTREAM_WORKSPACE: ${{ inputs.upstream_workspace }} |
| 68 | + ROS_DISTRO: ${{ inputs.ros_distro }} |
| 69 | + ROS_REPO: ${{ inputs.ros_repo }} |
| 70 | + CMAKE_ARGS: -DUR_ROBOT_DRIVER_BUILD_INTEGRATION_TESTS=ON |
| 71 | + ADDITIONAL_DEBS: docker.io netcat-openbsd # Needed for integration tests |
0 commit comments