action.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: windows-build-steps
  2. runs:
  3. using: composite
  4. steps:
  5. - name: Add msbuild to PATH
  6. uses: microsoft/setup-msbuild@v1.3.1
  7. - name: Cache ccache directory
  8. id: ccache-cache
  9. uses: actions/cache@v4
  10. with:
  11. path: C:\a\rocksdb\rocksdb\.ccache
  12. key: rocksdb-build-${{ runner.os }}-${{ runner.arch }}-ccache-${{ hashFiles('CMakeLists.txt', 'cmake/**/*.cmake') }}-v1
  13. - name: ccache
  14. uses: hendrikmuhs/ccache-action@v1.2
  15. with:
  16. max-size: "10GB"
  17. - name: Custom steps
  18. env:
  19. THIRDPARTY_HOME: ${{ github.workspace }}/thirdparty
  20. CMAKE_HOME: C:/Program Files/CMake
  21. CMAKE_BIN: C:/Program Files/CMake/bin/cmake.exe
  22. CTEST_BIN: C:/Program Files/CMake/bin/ctest.exe
  23. JAVA_HOME: C:/Program Files/BellSoft/LibericaJDK-8
  24. SNAPPY_HOME: ${{ github.workspace }}/thirdparty/snappy-1.2.2
  25. SNAPPY_INCLUDE: ${{ github.workspace }}/thirdparty/snappy-1.2.2;${{ github.workspace }}/thirdparty/snappy-1.2.2/build
  26. SNAPPY_LIB_DEBUG: ${{ github.workspace }}/thirdparty/snappy-1.2.2/build/Debug/snappy.lib
  27. run: |-
  28. # NOTE: if ... Exit $LASTEXITCODE lines needed to exit and report failure
  29. echo ===================== Install Dependencies =====================
  30. choco install liberica8jdk -y
  31. if(!$?) { Exit $LASTEXITCODE }
  32. mkdir $Env:THIRDPARTY_HOME
  33. cd $Env:THIRDPARTY_HOME
  34. echo "Building Snappy dependency..."
  35. curl -Lo snappy-1.2.2.zip https://github.com/google/snappy/archive/refs/tags/1.2.2.zip
  36. if(!$?) { Exit $LASTEXITCODE }
  37. unzip -q snappy-1.2.2.zip
  38. if(!$?) { Exit $LASTEXITCODE }
  39. cd snappy-1.2.2
  40. mkdir build
  41. cd build
  42. & cmake -G "$Env:CMAKE_GENERATOR" .. -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF
  43. if(!$?) { Exit $LASTEXITCODE }
  44. msbuild Snappy.sln -maxCpuCount -property:Configuration=Debug -property:Platform=x64
  45. if(!$?) { Exit $LASTEXITCODE }
  46. echo ======================== Build RocksDB =========================
  47. cd ${{ github.workspace }}
  48. $env:Path = $env:JAVA_HOME + ";" + $env:Path
  49. mkdir build
  50. cd build
  51. & cmake -G "$Env:CMAKE_GENERATOR" -DCMAKE_BUILD_TYPE=Debug -DWIN_CI=1 -DPORTABLE="$Env:CMAKE_PORTABLE" -DSNAPPY=1 -DXPRESS=1 -DJNI=1 ..
  52. if(!$?) { Exit $LASTEXITCODE }
  53. cd ..
  54. echo "Building with VS version: $Env:CMAKE_GENERATOR"
  55. # use more parallel processes than the number of processes available, as most of the compile command would be cache hit
  56. msbuild build/rocksdb.sln /m:32 /p:LinkIncremental=false -property:Configuration=Debug -property:Platform=x64
  57. if(!$?) { Exit $LASTEXITCODE }
  58. echo ========================= Test RocksDB =========================
  59. build_tools\run_ci_db_test.ps1 -SuiteRun arena_test,db_basic_test,db_test,db_test2,db_merge_operand_test,bloom_test,c_test,coding_test,crc32c_test,dynamic_bloom_test,env_basic_test,env_test,hash_test,random_test -Concurrency 16
  60. if(!$?) { Exit $LASTEXITCODE }
  61. echo ======================== Test RocksJava ========================
  62. cd build\java
  63. & ctest -C Debug -j 16
  64. if(!$?) { Exit $LASTEXITCODE }
  65. shell: pwsh
  66. - name: Show ccache stats
  67. shell: pwsh
  68. run: |
  69. ccache --show-stats -v