action.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Build
  2. description: Build YDB
  3. inputs:
  4. sanitizer:
  5. required: false
  6. type: string
  7. ccache_remote_path:
  8. required: false
  9. description: "ccache remote storage definition"
  10. extra_compile_flags:
  11. required: false
  12. default: ""
  13. description: "extra compile flags will be added to the end of C_FLAGS and CXX_FLAGS"
  14. runs:
  15. using: "composite"
  16. steps:
  17. - name: Configure for sanitizer
  18. shell: bash
  19. if: inputs.sanitizer
  20. run: |
  21. mkdir -p ../build
  22. patch -p1 < ydb/deploy/patches/0001-sanitizer-build.patch
  23. cd ../build
  24. rm -rf *
  25. export CC=/usr/bin/clang-14
  26. export CC_FOR_BUILD=$CC
  27. cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
  28. -DCCACHE_PATH=/usr/local/bin/ccache \
  29. -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain \
  30. -DCMAKE_CXX_FLAGS="-fsanitize=${{ inputs.sanitizer }} -g -gsplit-dwarf -gz -fno-omit-frame-pointer ${{ inputs.extra_compile_flags }}" \
  31. -DCMAKE_C_FLAGS="-fsanitize=${{ inputs.sanitizer }} -g -gsplit-dwarf -gz -fno-omit-frame-pointer ${{ inputs.extra_compile_flags }}" \
  32. ../ydb
  33. - name: Configure
  34. shell: bash
  35. if: ${{!inputs.sanitizer}}
  36. run: |
  37. mkdir -p ../build
  38. cd ../build
  39. rm -rf *
  40. export CONAN_USER_HOME=`pwd`
  41. export CC=/usr/bin/clang-14
  42. export CC_FOR_BUILD=$CC
  43. # FIXME: set DCMAKE_CXX_FLAGS_RELWITHDEBINFO and DCMAKE_CXX_FLAGS bacause of global_flags.cmake flags override.
  44. cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
  45. -DCCACHE_PATH=/usr/local/bin/ccache \
  46. -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain \
  47. -DCMAKE_C_FLAGS="${{ inputs.extra_compile_flags }}" \
  48. -DCMAKE_CXX_FLAGS="${{ inputs.extra_compile_flags }}" \
  49. ../ydb
  50. - name: Build
  51. shell: bash
  52. run: |
  53. ccache -z
  54. export CCACHE_BASEDIR=`realpath ..`
  55. export CCACHE_REMOTE_STORAGE="${{inputs.ccache_remote_path}}"
  56. export CCACHE_SLOPPINESS=locale
  57. export CCACHE_MAXSIZE=50G
  58. cd ../build
  59. ninja
  60. ccache -s
  61. df -h
  62. - name: report Build failed
  63. if: ${{ failure() }}
  64. shell: bash
  65. run: |
  66. echo "# Build failed" >> $GITHUB_STEP_SUMMARY
  67. - name: report Build cancelled
  68. if: ${{ cancelled() }}
  69. shell: bash
  70. run: |
  71. echo "# Build cancelled" >> $GITHUB_STEP_SUMMARY