env.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #!/bin/bash
  2. set -e -u
  3. FLAVOR=${1:-}
  4. cat <<EOF >> "$GITHUB_PATH"
  5. $HOME/.local/bin
  6. EOF
  7. cat <<EOF >> "$GITHUB_ENV"
  8. CI_BUILD_DIR=$GITHUB_WORKSPACE
  9. BUILD_DIR=$GITHUB_WORKSPACE/build
  10. DEPS_BUILD_DIR=$HOME/nvim-deps
  11. INSTALL_PREFIX=$HOME/nvim-install
  12. LOG_DIR=$GITHUB_WORKSPACE/build/log
  13. NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
  14. VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
  15. CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
  16. CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
  17. CACHE_UNCRUSTIFY=$HOME/.cache/uncrustify
  18. UNCRUSTIFY_VERSION=uncrustify-0.75.0
  19. EOF
  20. DEPS_CMAKE_FLAGS=
  21. FUNCTIONALTEST=functionaltest
  22. BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
  23. case "$FLAVOR" in
  24. asan)
  25. BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
  26. cat <<EOF >> "$GITHUB_ENV"
  27. CLANG_SANITIZER=ASAN_UBSAN
  28. SYMBOLIZER=asan_symbolize-13
  29. ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
  30. UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
  31. EOF
  32. ;;
  33. tsan)
  34. cat <<EOF >> "$GITHUB_ENV"
  35. TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
  36. CLANG_SANITIZER=TSAN
  37. EOF
  38. ;;
  39. uchar)
  40. cat <<EOF >> "$GITHUB_ENV"
  41. BUILD_UCHAR=1
  42. EOF
  43. ;;
  44. lint)
  45. # Re-enable once system deps are available
  46. # BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1"
  47. DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
  48. cat <<EOF >> "$GITHUB_ENV"
  49. USE_BUNDLED=OFF
  50. EOF
  51. ;;
  52. functionaltest-lua)
  53. BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
  54. FUNCTIONALTEST=functionaltest-lua
  55. DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
  56. ;;
  57. *)
  58. ;;
  59. esac
  60. cat <<EOF >> "$GITHUB_ENV"
  61. $BUILD_FLAGS
  62. DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS
  63. FUNCTIONALTEST=$FUNCTIONALTEST
  64. EOF