pr-jobs.yml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. name: facebook/rocksdb/pr-jobs
  2. on: [push, pull_request]
  3. permissions: {}
  4. jobs:
  5. # NOTE: multiple workflows would be recommended, but the current GHA UI in
  6. # PRs doesn't make it clear when there's an overall error with a workflow,
  7. # making it easy to overlook something broken. Grouping everything into one
  8. # workflow minimizes the problem because it will be suspicious if there are
  9. # no GHA results.
  10. #
  11. # The if: ${{ github.repository_owner == 'facebook' }} lines prevent the
  12. # jobs from attempting to run on repo forks, because of a few problems:
  13. # * runs-on labels are repository (owner) specific, so the job might wait
  14. # for days waiting for a runner that simply isn't available.
  15. # * Pushes to branches on forks for pull requests (the normal process) would
  16. # run the workflow jobs twice: once in the pull-from fork and once for the PR
  17. # destination repo. This is wasteful and dumb.
  18. # * It is not known how to avoid copy-pasting the line to each job,
  19. # increasing the risk of misconfiguration, especially on forks that might
  20. # want to run with this GHA setup.
  21. #
  22. # DEBUGGING WITH SSH: Temporarily add this as a job step, either before the
  23. # step of interest without the "if:" line or after the failing step with the
  24. # "if:" line. Then use ssh command printed in CI output.
  25. # - name: Setup tmate session # TEMPORARY!
  26. # if: ${{ failure() }}
  27. # uses: mxschmitt/action-tmate@v3
  28. # with:
  29. # limit-access-to-actor: true
  30. # ======================== Fast Initial Checks ====================== #
  31. check-format-and-targets:
  32. if: ${{ github.repository_owner == 'facebook' }}
  33. runs-on: ubuntu-24.04
  34. steps:
  35. - uses: actions/checkout@v4.1.0
  36. with:
  37. fetch-depth: 0 # Need full checkout to determine merge base
  38. fetch-tags: true
  39. - uses: "./.github/actions/setup-upstream"
  40. - name: Setup Python
  41. uses: actions/setup-python@v5
  42. - name: Install Dependencies
  43. run: python -m pip install --upgrade pip
  44. - name: Install argparse
  45. run: pip install argparse
  46. - name: Download clang-format-diff.py
  47. run: wget https://rocksdb-deps.s3.us-west-2.amazonaws.com/llvm/llvm-project/release/12.x/clang/tools/clang-format/clang-format-diff.py
  48. - name: Check format
  49. run: VERBOSE_CHECK=1 make check-format
  50. - name: Compare buckify output
  51. run: make check-buck-targets
  52. - name: Simple source code checks
  53. run: make check-sources
  54. - name: Sanity check check_format_compatible.sh
  55. run: |-
  56. export TEST_TMPDIR=/dev/shm/rocksdb
  57. rm -rf /dev/shm/rocksdb
  58. mkdir /dev/shm/rocksdb
  59. git reset --hard
  60. git config --global --add safe.directory /__w/rocksdb/rocksdb
  61. SANITY_CHECK=1 LONG_TEST=1 tools/check_format_compatible.sh
  62. # ========================= Linux With Tests ======================== #
  63. build-linux:
  64. if: ${{ github.repository_owner == 'facebook' }}
  65. runs-on:
  66. labels: 16-core-ubuntu
  67. container:
  68. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  69. options: --shm-size=16gb
  70. steps:
  71. - uses: actions/checkout@v4.1.0
  72. - uses: "./.github/actions/pre-steps"
  73. - run: make V=1 J=32 -j32 check
  74. - uses: "./.github/actions/post-steps"
  75. build-linux-cmake-mingw:
  76. if: ${{ github.repository_owner == 'facebook' }}
  77. runs-on:
  78. labels: 4-core-ubuntu
  79. container:
  80. image: ghcr.io/facebook/rocksdb_ubuntu:24.0
  81. options: --shm-size=16gb
  82. steps:
  83. - uses: actions/checkout@v4.1.0
  84. - uses: "./.github/actions/pre-steps"
  85. - run: update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
  86. - name: Build cmake-mingw
  87. run: |-
  88. export PATH=$JAVA_HOME/bin:$PATH
  89. echo "JAVA_HOME=${JAVA_HOME}"
  90. which java && java -version
  91. which javac && javac -version
  92. mkdir build && cd build && cmake -DJNI=1 -DWITH_GFLAGS=OFF .. -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_SYSTEM_NAME=Windows && make -j4 rocksdb rocksdbjni
  93. - uses: "./.github/actions/post-steps"
  94. build-linux-cmake-with-folly:
  95. if: ${{ github.repository_owner == 'facebook' }}
  96. runs-on:
  97. labels: 16-core-ubuntu
  98. container:
  99. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  100. options: --shm-size=16gb
  101. steps:
  102. - uses: actions/checkout@v4.1.0
  103. - uses: "./.github/actions/pre-steps"
  104. - uses: "./.github/actions/setup-folly"
  105. - uses: "./.github/actions/cache-folly"
  106. id: cache-folly
  107. - uses: "./.github/actions/build-folly"
  108. with:
  109. cache-hit: ${{ steps.cache-folly.outputs.cache-hit }}
  110. - run: "(mkdir build && cd build && cmake -DUSE_FOLLY=1 -DWITH_GFLAGS=1 -DROCKSDB_BUILD_SHARED=0 .. && make V=1 -j20 && ctest -j20)"
  111. - uses: "./.github/actions/post-steps"
  112. build-linux-make-with-folly:
  113. if: ${{ github.repository_owner == 'facebook' }}
  114. runs-on:
  115. labels: 16-core-ubuntu
  116. container:
  117. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  118. options: --shm-size=16gb
  119. steps:
  120. - uses: actions/checkout@v4.1.0
  121. - uses: "./.github/actions/pre-steps"
  122. - uses: "./.github/actions/setup-folly"
  123. - uses: "./.github/actions/cache-folly"
  124. id: cache-folly
  125. - uses: "./.github/actions/build-folly"
  126. with:
  127. cache-hit: ${{ steps.cache-folly.outputs.cache-hit }}
  128. - run: USE_FOLLY=1 LIB_MODE=static V=1 make -j32 check
  129. - uses: "./.github/actions/post-steps"
  130. build-linux-make-with-folly-lite-no-test:
  131. if: ${{ github.repository_owner == 'facebook' }}
  132. runs-on:
  133. labels: 16-core-ubuntu
  134. container:
  135. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  136. options: --shm-size=16gb
  137. steps:
  138. - uses: actions/checkout@v4.1.0
  139. - uses: "./.github/actions/pre-steps"
  140. - uses: "./.github/actions/setup-folly"
  141. - run: USE_FOLLY_LITE=1 EXTRA_CXXFLAGS=-DGLOG_USE_GLOG_EXPORT V=1 make -j32 all
  142. - uses: "./.github/actions/post-steps"
  143. build-linux-cmake-with-folly-coroutines:
  144. if: ${{ github.repository_owner == 'facebook' }}
  145. runs-on:
  146. labels: 16-core-ubuntu
  147. container:
  148. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  149. options: --shm-size=16gb
  150. steps:
  151. - uses: actions/checkout@v4.1.0
  152. - uses: "./.github/actions/pre-steps"
  153. - uses: "./.github/actions/setup-folly"
  154. - uses: "./.github/actions/cache-folly"
  155. id: cache-folly
  156. - uses: "./.github/actions/build-folly"
  157. with:
  158. cache-hit: ${{ steps.cache-folly.outputs.cache-hit }}
  159. - run: "(mkdir build && cd build && cmake -DUSE_COROUTINES=1 -DWITH_GFLAGS=1 -DROCKSDB_BUILD_SHARED=0 .. && make V=1 -j20 && ctest -j20)"
  160. - uses: "./.github/actions/post-steps"
  161. build-linux-cmake-with-benchmark:
  162. if: ${{ github.repository_owner == 'facebook' }}
  163. runs-on:
  164. labels: 16-core-ubuntu
  165. container:
  166. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  167. options: --shm-size=16gb
  168. steps:
  169. - uses: actions/checkout@v4.1.0
  170. - uses: "./.github/actions/pre-steps"
  171. - run: mkdir build && cd build && cmake -DWITH_GFLAGS=1 -DWITH_BENCHMARK=1 .. && make V=1 -j20 && ctest -j20
  172. - uses: "./.github/actions/post-steps"
  173. build-linux-encrypted_env-no_compression:
  174. if: ${{ github.repository_owner == 'facebook' }}
  175. runs-on:
  176. labels: 16-core-ubuntu
  177. container:
  178. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  179. options: --shm-size=16gb
  180. steps:
  181. - uses: actions/checkout@v4.1.0
  182. - uses: "./.github/actions/pre-steps"
  183. - run: ENCRYPTED_ENV=1 ROCKSDB_DISABLE_SNAPPY=1 ROCKSDB_DISABLE_ZLIB=1 ROCKSDB_DISABLE_BZIP=1 ROCKSDB_DISABLE_LZ4=1 ROCKSDB_DISABLE_ZSTD=1 make V=1 J=32 -j32 check
  184. - run: "./sst_dump --help | grep -E -q 'Supported built-in compression types: kNoCompression$' # Verify no compiled in compression\n"
  185. - uses: "./.github/actions/post-steps"
  186. # ======================== Linux No Test Runs ======================= #
  187. build-linux-release:
  188. if: ${{ github.repository_owner == 'facebook' }}
  189. runs-on:
  190. labels: 16-core-ubuntu
  191. container:
  192. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  193. options: --shm-size=16gb
  194. steps:
  195. - uses: actions/checkout@v4.1.0
  196. - run: make V=1 -j32 LIB_MODE=shared release
  197. - run: ls librocksdb.so
  198. - run: "./trace_analyzer --version" # A tool dependent on gflags that can run in release build
  199. - run: make clean
  200. - run: USE_RTTI=1 make V=1 -j32 release
  201. - run: ls librocksdb.a
  202. - run: "./trace_analyzer --version"
  203. - run: make clean
  204. - run: apt-get remove -y libgflags-dev
  205. - run: make V=1 -j32 LIB_MODE=shared release
  206. - run: ls librocksdb.so
  207. - run: if ./trace_analyzer --version; then false; else true; fi
  208. - run: make clean
  209. - run: USE_RTTI=1 make V=1 -j32 release
  210. - run: ls librocksdb.a
  211. - run: if ./trace_analyzer --version; then false; else true; fi
  212. - uses: "./.github/actions/post-steps"
  213. build-linux-clang-13-no_test_run:
  214. if: ${{ github.repository_owner == 'facebook' }}
  215. runs-on:
  216. labels: 8-core-ubuntu
  217. container:
  218. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  219. options: --shm-size=16gb
  220. steps:
  221. - uses: actions/checkout@v4.1.0
  222. - uses: "./.github/actions/pre-steps"
  223. # FIXME: get back to "all microbench" targets
  224. - run: CC=clang-13 CXX=clang++-13 USE_CLANG=1 EXTRA_CXXFLAGS=-stdlib=libc++ EXTRA_LDFLAGS=-stdlib=libc++ make -j32 shared_lib
  225. - run: make clean
  226. # FIXME: get back to "release" target
  227. - run: CC=clang-13 CXX=clang++-13 USE_CLANG=1 EXTRA_CXXFLAGS=-stdlib=libc++ EXTRA_LDFLAGS=-stdlib=libc++ DEBUG_LEVEL=0 make -j32 shared_lib
  228. - uses: "./.github/actions/post-steps"
  229. build-linux-clang-18-no_test_run:
  230. if: ${{ github.repository_owner == 'facebook' }}
  231. runs-on:
  232. labels: 16-core-ubuntu
  233. container:
  234. image: ghcr.io/facebook/rocksdb_ubuntu:24.0
  235. options: --shm-size=16gb
  236. steps:
  237. - uses: actions/checkout@v4.1.0
  238. - uses: "./.github/actions/pre-steps"
  239. - run: CC=clang-18 CXX=clang++-18 USE_CLANG=1 make -j32 all microbench
  240. - run: make clean
  241. - run: CC=clang-18 CXX=clang++-18 USE_CLANG=1 DEBUG_LEVEL=0 make -j32 release
  242. - uses: "./.github/actions/post-steps"
  243. build-linux-gcc-14-no_test_run:
  244. if: ${{ github.repository_owner == 'facebook' }}
  245. runs-on:
  246. labels: 16-core-ubuntu
  247. container:
  248. image: ghcr.io/facebook/rocksdb_ubuntu:24.0
  249. options: --shm-size=16gb
  250. steps:
  251. - uses: actions/checkout@v4.1.0
  252. - uses: "./.github/actions/pre-steps"
  253. - run: CC=gcc-14 CXX=g++-14 V=1 make -j32 all microbench
  254. - uses: "./.github/actions/post-steps"
  255. # ======================== Linux Other Checks ======================= #
  256. build-linux-clang18-clang-analyze:
  257. if: ${{ github.repository_owner == 'facebook' }}
  258. runs-on:
  259. labels: 16-core-ubuntu
  260. container:
  261. image: ghcr.io/facebook/rocksdb_ubuntu:24.0
  262. options: --shm-size=16gb
  263. steps:
  264. - uses: actions/checkout@v4.1.0
  265. - uses: "./.github/actions/pre-steps"
  266. - run: CC=clang-18 CXX=clang++-18 ROCKSDB_DISABLE_ALIGNED_NEW=1 CLANG_ANALYZER="/usr/bin/clang++-18" CLANG_SCAN_BUILD=scan-build-18 USE_CLANG=1 make V=1 -j32 analyze
  267. - uses: "./.github/actions/post-steps"
  268. - name: compress test report
  269. run: tar -cvzf scan_build_report.tar.gz scan_build_report
  270. if: failure()
  271. - uses: actions/upload-artifact@v4.0.0
  272. with:
  273. name: scan-build-report
  274. path: scan_build_report.tar.gz
  275. build-linux-unity-and-headers:
  276. if: ${{ github.repository_owner == 'facebook' }}
  277. runs-on:
  278. labels: 4-core-ubuntu
  279. container:
  280. image: gcc:latest
  281. options: --shm-size=16gb
  282. steps:
  283. - uses: actions/checkout@v4.1.0
  284. - run: apt-get update -y && apt-get install -y libgflags-dev
  285. - name: Unity build
  286. run: make V=1 -j8 unity_test
  287. - run: make V=1 -j8 -k check-headers
  288. - uses: "./.github/actions/post-steps"
  289. build-linux-mini-crashtest:
  290. if: ${{ github.repository_owner == 'facebook' }}
  291. runs-on:
  292. labels: 4-core-ubuntu
  293. container:
  294. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  295. options: --shm-size=16gb
  296. steps:
  297. - uses: actions/checkout@v4.1.0
  298. - uses: "./.github/actions/pre-steps"
  299. - run: ulimit -S -n `ulimit -H -n` && make V=1 -j8 CRASH_TEST_EXT_ARGS='--duration=960 --max_key=2500000' blackbox_crash_test_with_atomic_flush
  300. - uses: "./.github/actions/post-steps"
  301. # ======================= Linux with Sanitizers ===================== #
  302. build-linux-clang18-asan-ubsan:
  303. if: ${{ github.repository_owner == 'facebook' }}
  304. runs-on:
  305. labels: 32-core-ubuntu
  306. container:
  307. image: ghcr.io/facebook/rocksdb_ubuntu:24.0
  308. options: --shm-size=16gb
  309. steps:
  310. - uses: actions/checkout@v4.1.0
  311. - uses: "./.github/actions/pre-steps"
  312. - run: COMPILE_WITH_ASAN=1 COMPILE_WITH_UBSAN=1 CC=clang-18 CXX=clang++-18 ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 make V=1 -j40 check
  313. - uses: "./.github/actions/post-steps"
  314. build-linux-clang18-mini-tsan:
  315. if: ${{ github.repository_owner == 'facebook' }}
  316. runs-on:
  317. labels: 32-core-ubuntu
  318. container:
  319. image: ghcr.io/facebook/rocksdb_ubuntu:24.0
  320. options: --shm-size=16gb
  321. steps:
  322. - uses: actions/checkout@v4.1.0
  323. - uses: "./.github/actions/pre-steps"
  324. - run: COMPILE_WITH_TSAN=1 CC=clang-18 CXX=clang++-18 ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 make V=1 -j32 check
  325. - uses: "./.github/actions/post-steps"
  326. build-linux-static_lib-alt_namespace-status_checked:
  327. if: ${{ github.repository_owner == 'facebook' }}
  328. runs-on:
  329. labels: 16-core-ubuntu
  330. container:
  331. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  332. options: --shm-size=16gb
  333. steps:
  334. - uses: actions/checkout@v4.1.0
  335. - uses: "./.github/actions/pre-steps"
  336. - run: ASSERT_STATUS_CHECKED=1 TEST_UINT128_COMPAT=1 ROCKSDB_MODIFY_NPHASH=1 LIB_MODE=static OPT="-DROCKSDB_USE_STD_SEMAPHORES -DROCKSDB_NAMESPACE=alternative_rocksdb_ns" make V=1 -j24 check
  337. - uses: "./.github/actions/post-steps"
  338. # ========================= MacOS build only ======================== #
  339. build-macos:
  340. if: ${{ github.repository_owner == 'facebook' }}
  341. runs-on: macos-15-xlarge
  342. env:
  343. ROCKSDB_DISABLE_JEMALLOC: 1
  344. steps:
  345. - uses: actions/checkout@v4.1.0
  346. - uses: maxim-lobanov/setup-xcode@v1.6.0
  347. with:
  348. xcode-version: 16.4.0
  349. - uses: "./.github/actions/increase-max-open-files-on-macos"
  350. - uses: "./.github/actions/install-gflags-on-macos"
  351. - uses: "./.github/actions/pre-steps-macos"
  352. - name: Build
  353. run: ulimit -S -n `ulimit -H -n` && make V=1 J=16 -j8 all
  354. - uses: "./.github/actions/post-steps"
  355. # ========================= MacOS with Tests ======================== #
  356. build-macos-cmake:
  357. if: ${{ github.repository_owner == 'facebook' }}
  358. runs-on: macos-15-xlarge
  359. strategy:
  360. matrix:
  361. run_sharded_tests: [0, 1, 2, 3]
  362. steps:
  363. - uses: actions/checkout@v4.1.0
  364. - uses: maxim-lobanov/setup-xcode@v1.6.0
  365. with:
  366. xcode-version: 16.4.0
  367. - uses: "./.github/actions/increase-max-open-files-on-macos"
  368. - uses: "./.github/actions/install-gflags-on-macos"
  369. - uses: "./.github/actions/pre-steps-macos"
  370. - name: cmake generate project file
  371. run: ulimit -S -n `ulimit -H -n` && mkdir build && cd build && cmake -DWITH_GFLAGS=1 ..
  372. - name: Build tests
  373. run: cd build && make V=1 -j8
  374. - name: Run shard 0 out of 4 test shards
  375. run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 0,,4
  376. if: ${{ matrix.run_sharded_tests == 0 }}
  377. - name: Run shard 1 out of 4 test shards
  378. run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 1,,4
  379. if: ${{ matrix.run_sharded_tests == 1 }}
  380. - name: Run shard 2 out of 4 test shards
  381. run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 2,,4
  382. if: ${{ matrix.run_sharded_tests == 2 }}
  383. - name: Run shard 3 out of 4 test shards
  384. run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 3,,4
  385. if: ${{ matrix.run_sharded_tests == 3 }}
  386. - uses: "./.github/actions/post-steps"
  387. # ======================== Windows with Tests ======================= #
  388. # NOTE: some windows jobs are in "nightly" to save resources
  389. build-windows-vs2022:
  390. if: ${{ github.repository_owner == 'facebook' }}
  391. runs-on: windows-8-core
  392. env:
  393. CMAKE_GENERATOR: Visual Studio 17 2022
  394. CMAKE_PORTABLE: 1
  395. steps:
  396. - uses: actions/checkout@v4.1.0
  397. - uses: "./.github/actions/windows-build-steps"
  398. # ============================ Java Jobs ============================ #
  399. build-linux-java:
  400. if: ${{ github.repository_owner == 'facebook' }}
  401. runs-on:
  402. labels: 4-core-ubuntu
  403. container:
  404. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  405. options: --shm-size=16gb
  406. steps:
  407. # The docker image is intentionally based on an OS that has an older GLIBC version.
  408. # That GLIBC is incompatibile with GitHub's actions/checkout. Thus we implement a manual checkout step.
  409. # NOTE: replaced evolvedbinary/rocksjava:centos7_x64-be with ghcr.io/facebook/rocksdb_ubuntu:22.1
  410. # until a more appropriate docker image with C++20 support is made.
  411. - name: Checkout
  412. env:
  413. GH_TOKEN: ${{ github.token }}
  414. run: |
  415. chown `whoami` . || true
  416. git clone --no-checkout https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
  417. git -c protocol.version=2 fetch --update-head-ok --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}:${{ github.ref }}
  418. git checkout --progress --force ${{ github.ref }}
  419. git log -1 --format='%H'
  420. - uses: "./.github/actions/pre-steps"
  421. - name: Set Java Environment
  422. run: |-
  423. echo "JAVA_HOME=${JAVA_HOME}"
  424. which java && java -version
  425. which javac && javac -version
  426. - name: Test RocksDBJava
  427. # NOTE: replaced scl enable devtoolset-7 'make V=1 J=8 -j8 jtest'
  428. run: make V=1 J=8 -j8 jtest
  429. # post-steps skipped because of compatibility issues with docker image
  430. build-linux-java-static:
  431. if: ${{ github.repository_owner == 'facebook' }}
  432. runs-on:
  433. labels: 4-core-ubuntu
  434. container:
  435. image: ghcr.io/facebook/rocksdb_ubuntu:22.1
  436. options: --shm-size=16gb
  437. steps:
  438. # The docker image is intentionally based on an OS that has an older GLIBC version.
  439. # That GLIBC is incompatibile with GitHub's actions/checkout. Thus we implement a manual checkout step.
  440. # NOTE: replaced evolvedbinary/rocksjava:centos7_x64-be with ghcr.io/facebook/rocksdb_ubuntu:22.1
  441. # until a more appropriate docker image with C++20 support is made.
  442. - name: Checkout
  443. env:
  444. GH_TOKEN: ${{ github.token }}
  445. run: |
  446. chown `whoami` . || true
  447. git clone --no-checkout https://oath2:$GH_TOKEN@github.com/${{ github.repository }}.git .
  448. git -c protocol.version=2 fetch --update-head-ok --no-tags --prune --no-recurse-submodules --depth=1 origin +${{ github.sha }}:${{ github.ref }}
  449. git checkout --progress --force ${{ github.ref }}
  450. git log -1 --format='%H'
  451. - uses: "./.github/actions/pre-steps"
  452. - name: Set Java Environment
  453. run: |-
  454. echo "JAVA_HOME=${JAVA_HOME}"
  455. which java && java -version
  456. which javac && javac -version
  457. - name: Build RocksDBJava Static Library
  458. # NOTE: replaced scl enable devtoolset-7 'make V=1 J=8 -j8 rocksdbjavastatic'
  459. run: make V=1 J=8 -j8 rocksdbjavastatic
  460. # post-steps skipped because of compatibility issues with docker image
  461. build-macos-java:
  462. if: ${{ github.repository_owner == 'facebook' }}
  463. runs-on: macos-15-xlarge
  464. env:
  465. JAVA_HOME: "/Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home"
  466. ROCKSDB_DISABLE_JEMALLOC: 1
  467. steps:
  468. - uses: actions/checkout@v4.1.0
  469. - uses: maxim-lobanov/setup-xcode@v1.6.0
  470. with:
  471. xcode-version: 16.4.0
  472. - uses: "./.github/actions/increase-max-open-files-on-macos"
  473. - uses: "./.github/actions/install-gflags-on-macos"
  474. - uses: "./.github/actions/install-jdk8-on-macos"
  475. - uses: "./.github/actions/pre-steps-macos"
  476. - name: Set Java Environment
  477. run: |-
  478. echo "JAVA_HOME=${JAVA_HOME}"
  479. which java && java -version
  480. which javac && javac -version
  481. - name: Test RocksDBJava
  482. run: make V=1 J=16 -j16 jtest
  483. - uses: "./.github/actions/post-steps"
  484. build-macos-java-static:
  485. if: ${{ github.repository_owner == 'facebook' }}
  486. runs-on: macos-15-xlarge
  487. env:
  488. JAVA_HOME: "/Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home"
  489. steps:
  490. - uses: actions/checkout@v4.1.0
  491. - uses: maxim-lobanov/setup-xcode@v1.6.0
  492. with:
  493. xcode-version: 16.4.0
  494. - uses: "./.github/actions/increase-max-open-files-on-macos"
  495. - uses: "./.github/actions/install-gflags-on-macos"
  496. - uses: "./.github/actions/install-jdk8-on-macos"
  497. - uses: "./.github/actions/pre-steps-macos"
  498. - name: Set Java Environment
  499. run: |-
  500. echo "JAVA_HOME=${JAVA_HOME}"
  501. which java && java -version
  502. which javac && javac -version
  503. - name: Build RocksDBJava x86 and ARM Static Libraries
  504. run: make V=1 J=16 -j16 rocksdbjavastaticosx
  505. - uses: "./.github/actions/post-steps"
  506. build-macos-java-static-universal:
  507. if: ${{ github.repository_owner == 'facebook' }}
  508. runs-on: macos-15-xlarge
  509. env:
  510. JAVA_HOME: "/Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home"
  511. steps:
  512. - uses: actions/checkout@v4.1.0
  513. - uses: maxim-lobanov/setup-xcode@v1.6.0
  514. with:
  515. xcode-version: 16.4.0
  516. - uses: "./.github/actions/increase-max-open-files-on-macos"
  517. - uses: "./.github/actions/install-gflags-on-macos"
  518. - uses: "./.github/actions/install-jdk8-on-macos"
  519. - uses: "./.github/actions/pre-steps-macos"
  520. - name: Set Java Environment
  521. run: |-
  522. echo "JAVA_HOME=${JAVA_HOME}"
  523. which java && java -version
  524. which javac && javac -version
  525. - name: Build RocksDBJava Universal Binary Static Library
  526. run: make V=1 J=16 -j16 rocksdbjavastaticosx_ub
  527. - uses: "./.github/actions/post-steps"
  528. build-linux-java-pmd:
  529. if: ${{ github.repository_owner == 'facebook' }}
  530. runs-on:
  531. labels: 4-core-ubuntu
  532. container:
  533. image: evolvedbinary/rocksjava:alpine3_x64-be
  534. options: --shm-size=16gb
  535. steps:
  536. - uses: actions/checkout@v4.1.0
  537. - uses: "./.github/actions/install-maven"
  538. - uses: "./.github/actions/pre-steps"
  539. - name: Set Java Environment
  540. run: |-
  541. echo "JAVA_HOME=${JAVA_HOME}"
  542. which java && java -version
  543. which javac && javac -version
  544. - name: PMD RocksDBJava
  545. run: make V=1 J=8 -j8 jpmd
  546. - uses: actions/upload-artifact@v4.0.0
  547. with:
  548. name: pmd-report
  549. path: "${{ github.workspace }}/java/target/pmd.xml"
  550. - uses: actions/upload-artifact@v4.0.0
  551. with:
  552. name: maven-site
  553. path: "${{ github.workspace }}/java/target/site"
  554. build-linux-arm:
  555. if: ${{ github.repository_owner == 'facebook' }}
  556. runs-on:
  557. labels: 4-core-ubuntu-arm
  558. steps:
  559. - uses: actions/checkout@v4.1.0
  560. - uses: "./.github/actions/pre-steps"
  561. - run: sudo apt-get update && sudo apt-get install -y build-essential
  562. - run: ROCKSDBTESTS_PLATFORM_DEPENDENT=only make V=1 J=4 -j4 all_but_some_tests check_some
  563. - uses: "./.github/actions/post-steps"