From ac138a257591f3f56f1003c07bcf4b67c6e07a12 Mon Sep 17 00:00:00 2001 From: Tyler Marr Date: Thu, 6 Jul 2023 16:58:52 -0500 Subject: [PATCH] Combine CI builds into one file with a matrix --- .github/workflows/jammy_build.yml | 98 ------------------- .../workflows/{focal_build.yml => ubuntu.yml} | 15 +-- 2 files changed, 9 insertions(+), 104 deletions(-) delete mode 100644 .github/workflows/jammy_build.yml rename .github/workflows/{focal_build.yml => ubuntu.yml} (91%) diff --git a/.github/workflows/jammy_build.yml b/.github/workflows/jammy_build.yml deleted file mode 100644 index 5a80cca9..00000000 --- a/.github/workflows/jammy_build.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Jammy-Build - -on: - push: - branches: - - master - pull_request: - schedule: - - cron: '0 5 * * 6' - workflow_dispatch: - -jobs: - industrial_ci: - name: Humble - runs-on: ubuntu-22.04 - env: - CI_NAME: Jammy-Build - OS_NAME: ubuntu - OS_CODE_NAME: jammy - ROS_DISTRO: humble - ROS_REPO: main - BEFORE_INIT: './.add-gazebo-ppa' - UPSTREAM_WORKSPACE: 'dependencies_unstable.repos' - ROSDEP_SKIP_KEYS: "catkin taskflow orocos_kdl fcl gz-common5 gz-math7 gz-rendering7" - ADDITIONAL_DEBS: "libgz-common5-dev libgz-math7-dev libgz-rendering7-dev" - DOCKER_IMAGE: "ros:humble" - PARALLEL_TESTS: false - NOT_TEST_BUILD: true - BEFORE_RUN_TARGET_TEST_EMBED: "source /root/target_ws/install/local_setup.bash" - CCACHE_DIR: "/home/runner/work/tesseract_ros2/tesseract_ros2/Jammy-Build/.ccache" - UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release" - TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug" - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - PUSH_DOCKER_IMAGE: ${{ github.ref == 'refs/heads/master' || github.event_name == 'release' }} - steps: - - uses: actions/checkout@v1 - - - name: Free Disk Space - continue-on-error: true - run: | - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - docker rmi $(docker image ls -aq) - df -h - - - name: Prepare ccache timestamp - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) - message("::set-output name=timestamp::${current_date}") - - - name: ccache cache files - continue-on-error: true - uses: actions/cache@v1.1.0 - with: - path: ${{ env.CI_NAME }}/.ccache - key: ${{ env.CI_NAME }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} - restore-keys: | - ${{ env.CI_NAME }}-ccache- - - - name: Login to Github container registry - uses: docker/login-action@v1 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract Docker meta-information - id: meta - uses: docker/metadata-action@v3 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - flavor: | - latest=false - prefix= - suffix= - tags: | - type=ref,event=branch,prefix=${{ env.ROS_DISTRO }}- - type=semver,pattern={{major}}.{{minor}},prefix=${{ env.ROS_DISTRO }}- - - - name: Set build type - run: | - if [[ "${{ env.PUSH_DOCKER_IMAGE }}" = true ]] - then - echo "BUILD_TYPE=Release" >> $GITHUB_ENV - else - echo "BUILD_TYPE=Debug" >> $GITHUB_ENV - fi - - - uses: 'ros-industrial/industrial_ci@master' - env: ${{env}} - - - name: Push post-build Docker - if: ${{ env.PUSH_DOCKER_IMAGE == 'true' }} - run: docker push ${{ steps.meta.outputs.tags }} diff --git a/.github/workflows/focal_build.yml b/.github/workflows/ubuntu.yml similarity index 91% rename from .github/workflows/focal_build.yml rename to .github/workflows/ubuntu.yml index c8ad0510..0cf1a1df 100644 --- a/.github/workflows/focal_build.yml +++ b/.github/workflows/ubuntu.yml @@ -11,19 +11,22 @@ on: jobs: industrial_ci: - name: Foxy - runs-on: ubuntu-20.04 + name: ${{ matrix.distro }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + distro: [foxy, humble, rolling] env: - CI_NAME: Focal-Build + CI_NAME: ${{ matrix.distro }}-Build OS_NAME: ubuntu - OS_CODE_NAME: focal - ROS_DISTRO: foxy + ROS_DISTRO: ${{ matrix.distro }} ROS_REPO: main BEFORE_INIT: './.add-gazebo-ppa' UPSTREAM_WORKSPACE: 'dependencies_unstable.repos' ROSDEP_SKIP_KEYS: "catkin taskflow fcl gz-common5 gz-math7 gz-rendering7" ADDITIONAL_DEBS: "libgz-common5-dev libgz-math7-dev libgz-rendering7-dev" - DOCKER_IMAGE: "ros:foxy" + DOCKER_IMAGE: "ros:${{ matrix.distro }}" PARALLEL_TESTS: false NOT_TEST_BUILD: true BEFORE_RUN_TARGET_TEST_EMBED: "source /root/target_ws/install/local_setup.bash"