action.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. runs:
  11. using: "composite"
  12. steps:
  13. - name: Configure for sanitizer
  14. shell: bash
  15. if: inputs.sanitizer
  16. run: |
  17. mkdir -p ../build
  18. patch -p1 < ydb/deploy/patches/0001-sanitizer-build.patch
  19. cd ../build
  20. rm -rf *
  21. export CC=/usr/bin/clang-12
  22. export CC_FOR_BUILD=$CC
  23. cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
  24. -DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \
  25. -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain \
  26. -DCMAKE_CXX_FLAGS="-fsanitize=${{ inputs.sanitizer }} -g -gsplit-dwarf -gz -fno-omit-frame-pointer -UNDEBUG" \
  27. -DCMAKE_C_FLAGS="-fsanitize=${{ inputs.sanitizer }} -g -gsplit-dwarf -gz -fno-omit-frame-pointer -UNDEBUG" \
  28. ../ydb
  29. - name: Configure
  30. shell: bash
  31. if: ${{!inputs.sanitizer}}
  32. run: |
  33. mkdir -p ../build
  34. cd ../build
  35. rm -rf *
  36. export CONAN_USER_HOME=`pwd`
  37. export CC=/usr/bin/clang-12
  38. export CC_FOR_BUILD=$CC
  39. # FIXME: set DCMAKE_CXX_FLAGS_RELWITHDEBINFO and DCMAKE_CXX_FLAGS bacause of global_flags.cmake flags override.
  40. cmake -G Ninja -DCMAKE_BUILD_TYPE=Release \
  41. -DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache -DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \
  42. -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain \
  43. -DCMAKE_C_FLAGS="-O2 -UNDEBUG" \
  44. -DCMAKE_CXX_FLAGS="-O2 -UNDEBUG" \
  45. -DCMAKE_C_FLAGS_RELEASE="-O2 -UNDEBUG" \
  46. -DCMAKE_CXX_FLAGS_RELEASE="-O2 -UNDEBUG" \
  47. ../ydb
  48. - name: Build
  49. shell: bash
  50. run: |
  51. ccache -z
  52. export CCACHE_BASEDIR=`realpath ..`
  53. export CCACHE_REMOTE_STORAGE="${{inputs.ccache_remote_path}}"
  54. export CCACHE_SLOPPINESS=locale
  55. export CCACHE_MAXSIZE=50G
  56. cd ../build
  57. ninja
  58. ccache -s
  59. df -h