action.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. name: Build Godot
  2. description: Build Godot with the provided options.
  3. inputs:
  4. target:
  5. description: Build target (editor, template_release, template_debug).
  6. default: editor
  7. tests:
  8. description: Unit tests.
  9. default: false
  10. required: false
  11. platform:
  12. description: Target platform.
  13. required: false
  14. sconsflags:
  15. description: Additional SCons flags.
  16. default: ""
  17. required: false
  18. scons-cache:
  19. description: The SCons cache path.
  20. default: ${{ github.workspace }}/.scons_cache/
  21. scons-cache-limit:
  22. description: The SCons cache size limit.
  23. # actions/cache has 10 GiB limit, and GitHub runners have a 14 GiB disk.
  24. # Limit to 7 GiB to avoid having the extracted cache fill the disk.
  25. default: 7168
  26. runs:
  27. using: composite
  28. steps:
  29. - name: SCons Build
  30. shell: sh
  31. env:
  32. SCONSFLAGS: ${{ inputs.sconsflags }}
  33. SCONS_CACHE: ${{ inputs.scons-cache }}
  34. SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
  35. run: |
  36. echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
  37. if [ "${{ inputs.target }}" != "editor" ]; then
  38. # Ensure we don't include editor code in export template builds.
  39. rm -rf editor
  40. fi
  41. if [ "${{ github.event.number }}" != "" ]; then
  42. # Set build identifier with pull request number if available. This is displayed throughout the editor.
  43. export BUILD_NAME="gh-${{ github.event.number }}"
  44. else
  45. export BUILD_NAME="gh"
  46. fi
  47. scons platform=${{ inputs.platform }} target=${{ inputs.target }} tests=${{ inputs.tests }} ${{ env.SCONSFLAGS }}
  48. ls -l bin/