Build.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: Build
  2. on:
  3. pull_request:
  4. branches:
  5. - development
  6. paths:
  7. - ".github/workflows/Build.yml"
  8. - "Code/**"
  9. - "CMakeLists.txt"
  10. - "gem.json"
  11. permissions:
  12. contents: read
  13. jobs:
  14. build-with-empty-project:
  15. name: Build the Gem with an empty Project
  16. runs-on: self-hosted
  17. timeout-minutes: 60
  18. env:
  19. # vv Change the o3de hash (LONG FORMAT!) here to fit the build vv
  20. O3DE_SHA: 932a0327a58580028bb4a314b2d464dd974edaef
  21. ROS_DISTRO: galactic
  22. steps:
  23. - name: O3DE ROS 2 Gem checkout
  24. uses: actions/checkout@v3
  25. with:
  26. path: o3de-ros2-gem
  27. - name: O3DE checkout
  28. uses: actions/checkout@v3
  29. with:
  30. repository: o3de/o3de
  31. ref: ${{ env.O3DE_SHA }}
  32. path: o3de
  33. - name: O3DE git-lfs pull
  34. run: |
  35. cd o3de
  36. git lfs pull
  37. cd ..
  38. - name: Set RUNNER_HOME
  39. run: |
  40. RUNNER_WORK=$(pwd)
  41. cd ../../..
  42. echo "RUNNER_HOME=$(pwd)" >> $GITHUB_ENV
  43. cd $RUNNER_WORK
  44. - name: Register the Engine
  45. run: |
  46. mkdir -p ${{ env.RUNNER_HOME }}/o3de-packages
  47. o3de/python/get_python.sh
  48. o3de/scripts/o3de.sh register --this-engine --force
  49. - name: Create an empty Project
  50. run: |
  51. o3de/scripts/o3de.sh create-project \
  52. --project-path ${{ env.RUNNER_HOME }}/o3de-projects/EmptyProject
  53. - name: Add the O3DE ROS2 Gem to the Project
  54. run: |
  55. o3de/scripts/o3de.sh register --gem-path o3de-ros2-gem
  56. o3de/scripts/o3de.sh enable-gem -gn ROS2 \
  57. -pp ${{ env.RUNNER_HOME }}/o3de-projects/EmptyProject
  58. - name: Create the Linux build project for the Project
  59. run: |
  60. cd ${{ env.RUNNER_HOME }}/o3de-projects/EmptyProject
  61. cmake -B build/linux -S . -G "Ninja Multi-Config" \
  62. -DLY_3RDPARTY_PATH=${{ env.RUNNER_HOME }}/o3de-packages
  63. - name: Build the Project
  64. run: >
  65. cmake
  66. --build ${{ env.RUNNER_HOME }}/o3de-projects/EmptyProject/build/linux
  67. --config release
  68. --target EmptyProject Editor
  69. -j $(($(nproc) / 2))
  70. - name: Project Cleanup
  71. if: always()
  72. run: |
  73. rm -r ${{ env.RUNNER_HOME }}/o3de-projects/EmptyProject 2> /dev/null