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. CACHE_ENABLE=true
  9. CI_TARGET=tests
  10. CI_BUILD_DIR=$GITHUB_WORKSPACE
  11. BUILD_DIR=$GITHUB_WORKSPACE/build
  12. DEPS_BUILD_DIR=$HOME/nvim-deps
  13. INSTALL_PREFIX=$HOME/nvim-install
  14. LOG_DIR=$GITHUB_WORKSPACE/build/log
  15. NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
  16. VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
  17. CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
  18. CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
  19. CCACHE_BASEDIR=$GITHUB_WORKSPACE
  20. CCACHE_COMPRESS=1
  21. CCACHE_SLOPPINESS=time_macros,file_macro
  22. CCACHE_DIR=$HOME/.ccache
  23. EOF
  24. DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
  25. FUNCTIONALTEST=functionaltest
  26. 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"
  27. case "$FLAVOR" in
  28. asan)
  29. BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
  30. cat <<EOF >> "$GITHUB_ENV"
  31. CLANG_SANITIZER=ASAN_UBSAN
  32. SYMBOLIZER=asan_symbolize-13
  33. ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
  34. UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
  35. EOF
  36. ;;
  37. tsan)
  38. cat <<EOF >> "$GITHUB_ENV"
  39. TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
  40. CLANG_SANITIZER=TSAN
  41. EOF
  42. ;;
  43. lint)
  44. # Re-enable once system deps are available
  45. # 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"
  46. DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
  47. cat <<EOF >> "$GITHUB_ENV"
  48. USE_BUNDLED=OFF
  49. CI_TARGET=lint
  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