From a9c7e1e2e4697adb1b6fe1f8fc80e70e72418943 Mon Sep 17 00:00:00 2001 From: Nicole Cheetham Date: Thu, 17 Oct 2024 14:47:14 -0400 Subject: [PATCH] Refactor GHA ci --- .github/workflows/ament_cmake_installed.yml | 21 ++++ .github/workflows/bazel_download.yml | 21 ++++ .github/workflows/catkin_installed.yml | 21 ++++ .github/workflows/ci.yml | 121 ++----------------- .github/workflows/cmake_installed.yml | 63 ++++++++++ .github/workflows/cmake_installed_apt.yml | 21 ++++ .github/workflows/cmake_installed_ubuntu.yml | 21 ++++ 7 files changed, 175 insertions(+), 114 deletions(-) create mode 100644 .github/workflows/ament_cmake_installed.yml create mode 100644 .github/workflows/bazel_download.yml create mode 100644 .github/workflows/catkin_installed.yml create mode 100644 .github/workflows/cmake_installed.yml create mode 100644 .github/workflows/cmake_installed_apt.yml create mode 100644 .github/workflows/cmake_installed_ubuntu.yml diff --git a/.github/workflows/ament_cmake_installed.yml b/.github/workflows/ament_cmake_installed.yml new file mode 100644 index 00000000..20d597ea --- /dev/null +++ b/.github/workflows/ament_cmake_installed.yml @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: MIT-0 + +--- +name: ci +on: + workflow_call: + +jobs: + ros_humble_ament_cmake_installed: + name: ros 2 humble ament cmake installed + runs-on: ubuntu-latest + container: ubuntu:jammy + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + run: ./drake_ament_cmake_installed/.github/ros_humble_setup + shell: bash + - name: ament_cmake_installed build and test + run: ./drake_ament_cmake_installed/.github/ci_build_test + shell: bash \ No newline at end of file diff --git a/.github/workflows/bazel_download.yml b/.github/workflows/bazel_download.yml new file mode 100644 index 00000000..efb8b9b2 --- /dev/null +++ b/.github/workflows/bazel_download.yml @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: MIT-0 + +--- +name: ci +on: + workflow_call: + +jobs: + ubuntu_jammy_bazel_download: + name: ubuntu 22.04 jammy bazel download + runs-on: ubuntu-latest + container: ubuntu:jammy + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + run: ./scripts/continuous_integration/github_actions/ubuntu_setup + shell: bash + - name: bazel_download build and test + run: ./drake_bazel_download/.github/ci_build_test + shell: bash \ No newline at end of file diff --git a/.github/workflows/catkin_installed.yml b/.github/workflows/catkin_installed.yml new file mode 100644 index 00000000..65d9ace5 --- /dev/null +++ b/.github/workflows/catkin_installed.yml @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: MIT-0 + +--- +name: ci +on: + workflow_call: + +jobs: + ubuntu_jammy_catkin_installed: + name: ubuntu 22.04 jammy catkin installed + runs-on: ubuntu-latest + container: ubuntu:jammy + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + run: ./scripts/continuous_integration/github_actions/ubuntu_setup + shell: bash + - name: catkin_installed build and test + run: ./drake_catkin_installed/.github/ci_build_test + shell: bash \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 658db4cf..54813a6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ on: - main schedule: - cron: '0 12 * * *' + workflow_dispatch: concurrency: # Cancel previous CI runs when additional commits are added to a pull request. # This will not cancel CI runs associated with `schedule` or `push`. @@ -18,122 +19,14 @@ concurrency: cancel-in-progress: true jobs: macos_sonoma_arm_cmake_installed: - name: macos sonoma 14 arm cmake installed - runs-on: macos-14 - steps: - - name: checkout - uses: actions/checkout@v4 - # See issue https://github.com/actions/setup-python/issues/577. There is - # some kind of environment conflict between the symlinks found in the - # GitHub Actions runner and `brew upgrade python` where `brew` detects and - # refuses to overwrite symlinks. The cause for our runs is not clear, - # we do not use that action, but if that issue is closed this section - # can be removed. - - name: sanitize GHA / brew python environment - run: | - # Remove the symlinks that cause issues. - find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete - sudo rm -rf /Library/Frameworks/Python.framework/ - # - ###################################################################### - # For brew formulas that have issues during `brew upgrade` due to - # symlinks already existing, we use the strategy: - # brew list && (brew unlink ... ) - # The `brew list ` will error if it is not installed. When - # the logs say something like "No such keg: /some/path/" - # that means the band-aid can be removed from DEE CI. - ###################################################################### - # On 2023-02-24 `brew upgrade` resulted in a failure linking tcl-tk. - brew list tcl-tk && brew unlink tcl-tk - # - # On 2023-04-06 `brew upgrade` resulted in a failure upgrading `go`. - brew list go && ( \ - brew unlink go && \ - rm -f /usr/local/bin/go && \ - rm -f /usr/local/bin/gofmt \ - ) - # - # On 2023-09-25 there were issues upgrading node@18 from 18.17.1 to - # 18.18.0, caused by `brew upgrade`. - brew list node@18 && ( \ - brew unlink node@18 && \ - rm -rf /usr/local/lib/node_modules/ \ - ) - ###################################################################### - # Run upgrades now to fail-fast (setup scripts do this anyway). - ###################################################################### - brew update && brew upgrade - # On 2023-02-16 the pip3.11 symlink was mysteriously missing. - brew unlink python@3.11 && brew link python@3.11 - pip3.11 --version - - name: setup - run: ./drake_cmake_installed/setup/mac/install_prereqs - shell: zsh -efuo pipefail {0} - - name: cmake_installed build and test - run: ./drake_cmake_installed/.github/ci_build_test - shell: zsh -efuo pipefail {0} + uses: ./.github/workflows/cmake_installed.yml ros_humble_ament_cmake_installed: - name: ros 2 humble ament cmake installed - runs-on: ubuntu-latest - container: ubuntu:jammy - steps: - - name: checkout - uses: actions/checkout@v4 - - name: setup - run: ./drake_ament_cmake_installed/.github/ros_humble_setup - shell: bash - - name: ament_cmake_installed build and test - run: ./drake_ament_cmake_installed/.github/ci_build_test - shell: bash + uses: ./.github/workflows/ament_cmake_installed.yml ubuntu_jammy_bazel_download: - name: ubuntu 22.04 jammy bazel download - runs-on: ubuntu-latest - container: ubuntu:jammy - steps: - - name: checkout - uses: actions/checkout@v4 - - name: setup - run: ./scripts/continuous_integration/github_actions/ubuntu_setup - shell: bash - - name: bazel_download build and test - run: ./drake_bazel_download/.github/ci_build_test - shell: bash + uses: ./.github/workflows/bazel_download.yml ubuntu_jammy_catkin_installed: - name: ubuntu 22.04 jammy catkin installed - runs-on: ubuntu-latest - container: ubuntu:jammy - steps: - - name: checkout - uses: actions/checkout@v4 - - name: setup - run: ./scripts/continuous_integration/github_actions/ubuntu_setup - shell: bash - - name: catkin_installed build and test - run: ./drake_catkin_installed/.github/ci_build_test - shell: bash + uses: ./.github/workflows/catkin_installed.yml ubuntu_jammy_cmake_installed: - name: ubuntu 22.04 jammy cmake installed - runs-on: ubuntu-latest - container: ubuntu:jammy - steps: - - name: checkout - uses: actions/checkout@v4 - - name: setup - run: ./scripts/continuous_integration/github_actions/ubuntu_setup - shell: bash - - name: cmake_installed build and test - run: ./drake_cmake_installed/.github/ci_build_test - shell: bash + uses: ./.github/workflows/cmake_installed_ubuntu.yml ubuntu_jammy_cmake_installed_apt: - name: ubuntu 22.04 jammy cmake installed apt - runs-on: ubuntu-latest - container: ubuntu:jammy - steps: - - name: checkout - uses: actions/checkout@v4 - - name: setup - run: ./drake_cmake_installed_apt/.github/ubuntu_apt_setup - shell: bash - - name: cmake_installed_apt build and test - run: ./drake_cmake_installed_apt/.github/ci_build_test - shell: bash + uses: ./.github/workflows/cmake_installed_apt.yml \ No newline at end of file diff --git a/.github/workflows/cmake_installed.yml b/.github/workflows/cmake_installed.yml new file mode 100644 index 00000000..83d4de1f --- /dev/null +++ b/.github/workflows/cmake_installed.yml @@ -0,0 +1,63 @@ +# SPDX-License-Identifier: MIT-0 + +--- +name: ci +on: + workflow_call: + +jobs: + macos_sonoma_arm_cmake_installed: + name: macos sonoma 14 arm cmake installed + runs-on: macos-14 + steps: + - name: checkout + uses: actions/checkout@v4 + # See issue https://github.com/actions/setup-python/issues/577. There is + # some kind of environment conflict between the symlinks found in the + # GitHub Actions runner and `brew upgrade python` where `brew` detects and + # refuses to overwrite symlinks. The cause for our runs is not clear, + # we do not use that action, but if that issue is closed this section + # can be removed. + - name: sanitize GHA / brew python environment + run: | + # Remove the symlinks that cause issues. + find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete + sudo rm -rf /Library/Frameworks/Python.framework/ + # + ###################################################################### + # For brew formulas that have issues during `brew upgrade` due to + # symlinks already existing, we use the strategy: + # brew list && (brew unlink ... ) + # The `brew list ` will error if it is not installed. When + # the logs say something like "No such keg: /some/path/" + # that means the band-aid can be removed from DEE CI. + ###################################################################### + # On 2023-02-24 `brew upgrade` resulted in a failure linking tcl-tk. + brew list tcl-tk && brew unlink tcl-tk + # + # On 2023-04-06 `brew upgrade` resulted in a failure upgrading `go`. + brew list go && ( \ + brew unlink go && \ + rm -f /usr/local/bin/go && \ + rm -f /usr/local/bin/gofmt \ + ) + # + # On 2023-09-25 there were issues upgrading node@18 from 18.17.1 to + # 18.18.0, caused by `brew upgrade`. + brew list node@18 && ( \ + brew unlink node@18 && \ + rm -rf /usr/local/lib/node_modules/ \ + ) + ###################################################################### + # Run upgrades now to fail-fast (setup scripts do this anyway). + ###################################################################### + brew update && brew upgrade + # On 2023-02-16 the pip3.11 symlink was mysteriously missing. + brew unlink python@3.11 && brew link python@3.11 + pip3.11 --version + - name: setup + run: ./drake_cmake_installed/setup/mac/install_prereqs + shell: zsh -efuo pipefail {0} + - name: cmake_installed build and test + run: ./drake_cmake_installed/.github/ci_build_test + shell: zsh -efuo pipefail {0} \ No newline at end of file diff --git a/.github/workflows/cmake_installed_apt.yml b/.github/workflows/cmake_installed_apt.yml new file mode 100644 index 00000000..4184c754 --- /dev/null +++ b/.github/workflows/cmake_installed_apt.yml @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: MIT-0 + +--- +name: ci +on: + workflow_call: + +jobs: + ubuntu_jammy_cmake_installed_apt: + name: ubuntu 22.04 jammy cmake installed apt + runs-on: ubuntu-latest + container: ubuntu:jammy + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + run: ./drake_cmake_installed_apt/.github/ubuntu_apt_setup + shell: bash + - name: cmake_installed_apt build and test + run: ./drake_cmake_installed_apt/.github/ci_build_test + shell: bash \ No newline at end of file diff --git a/.github/workflows/cmake_installed_ubuntu.yml b/.github/workflows/cmake_installed_ubuntu.yml new file mode 100644 index 00000000..cd11c8e0 --- /dev/null +++ b/.github/workflows/cmake_installed_ubuntu.yml @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: MIT-0 + +--- +name: ci +on: + workflow_call: + +jobs: + ubuntu_jammy_cmake_installed: + name: ubuntu 22.04 jammy cmake installed + runs-on: ubuntu-latest + container: ubuntu:jammy + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + run: ./scripts/continuous_integration/github_actions/ubuntu_setup + shell: bash + - name: cmake_installed build and test + run: ./drake_cmake_installed/.github/ci_build_test + shell: bash \ No newline at end of file