gcc #1609
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
name: gcc | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * *' # 9:00am UTC, 1:00am PST. | |
env: | |
PACKAGE_NAME: maliput_infrastructure | |
ROS_DISTRO: foxy | |
ROS_WS: maliput_ws | |
UBUNTU_NAME: focal | |
UBUNTU_VERSION: 20.04 | |
# Cancel previously running PR jobs | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
jobs: | |
compile_and_test: | |
name: Compile and test | |
runs-on: ubuntu-latest | |
container: | |
image: ubuntu:20.04 | |
steps: | |
# setup-ros first since it installs git, which is needed to fetch all branches from actions/checkout | |
- uses: ros-tooling/[email protected] | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{ env.ROS_WS }}/src/${{ env.PACKAGE_NAME }} | |
# clone public dependencies | |
- name: vcs import | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
run: vcs import src < src/${PACKAGE_NAME}/.github/dependencies.repos | |
- name: check if dependencies have a matching branch | |
shell: bash | |
working-directory: ${{ env.ROS_WS }}/src | |
run: ./${PACKAGE_NAME}/.github/try_vcs_checkout ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} . | |
- run: colcon graph | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
- name: rosdep install | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
run: | | |
rosdep update --include-eol-distros; | |
rosdep install -i -y --rosdistro ${ROS_DISTRO} --from-paths src | |
- name: install drake | |
shell: bash | |
working-directory: ${{ env.ROS_WS }}/src/drake_vendor | |
run: ./drake_installer | |
- name: colcon build libraries | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
run: | | |
. /opt/ros/${ROS_DISTRO}/setup.bash; | |
colcon build --event-handlers=console_direct+ | |
- name: colcon test | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
run: | | |
. install/setup.bash; | |
colcon test --event-handlers=console_direct+; | |
colcon test-result --verbose; | |
# create tarball to push it as a github artifact | |
# Note that a file with the name of the bundle is created to pass the value | |
# step to step. | |
- name: Create tarball. | |
shell: bash | |
working-directory: ${{ env.ROS_WS }} | |
env: | |
BUNDLE_NAME: dsim_desktop | |
run: | | |
echo "Moving install space to ${BUNDLE_NAME}"; | |
mv install ${BUNDLE_NAME}; | |
CURRENT_BUNDLE_TARBALL_NAME="${BUNDLE_NAME}_$(date +%Y%m%d)_${{ env.UBUNTU_VERSION }}.tar.gz" | |
echo $CURRENT_BUNDLE_TARBALL_NAME > bundle_file_name | |
echo "bundle_file_name=${CURRENT_BUNDLE_TARBALL_NAME}" >> $GITHUB_ENV | |
echo "Compressing tarball ${CURRENT_BUNDLE_TARBALL_NAME}"; | |
tar -czvf ${CURRENT_BUNDLE_TARBALL_NAME} ${BUNDLE_NAME}; | |
- uses: actions/upload-artifact@v4 | |
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
with: | |
name: binary_underlay | |
path: ${{ env.ROS_WS}}/${{ env.bundle_file_name }} |