Fix memory leak in ExportColumnFamily for empty column families (#14458) #685
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: facebook/rocksdb/pr-jobs | |
| on: [push, pull_request] | |
| permissions: {} | |
| env: | |
| # Set to a job name to run only that job (on any repo), or leave empty for | |
| # normal behavior (all jobs on facebook repo only). | |
| ONLY_JOB: '' | |
| jobs: | |
| config: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| only_job: ${{ steps.set.outputs.only_job }} | |
| steps: | |
| - id: set | |
| run: echo "only_job=$ONLY_JOB" >> "$GITHUB_OUTPUT" | |
| # NOTE: multiple workflows would be recommended, but the current GHA UI in | |
| # PRs doesn't make it clear when there's an overall error with a workflow, | |
| # making it easy to overlook something broken. Grouping everything into one | |
| # workflow minimizes the problem because it will be suspicious if there are | |
| # no GHA results. | |
| # | |
| # The if: ${{ github.repository_owner == 'facebook' }} lines prevent the | |
| # jobs from attempting to run on repo forks, because of a few problems: | |
| # * runs-on labels are repository (owner) specific, so the job might wait | |
| # for days waiting for a runner that simply isn't available. | |
| # * Pushes to branches on forks for pull requests (the normal process) would | |
| # run the workflow jobs twice: once in the pull-from fork and once for the PR | |
| # destination repo. This is wasteful and dumb. | |
| # * It is not known how to avoid copy-pasting the line to each job, | |
| # increasing the risk of misconfiguration, especially on forks that might | |
| # want to run with this GHA setup. | |
| # | |
| # SELECTIVE JOB EXECUTION: Set the ONLY_JOB env var at the top of this file | |
| # to a job name (e.g. "build-linux-clang-tidy") to run only that job, | |
| # bypassing the repository owner check. Leave it empty for normal behavior. | |
| # | |
| # DEBUGGING WITH SSH: Temporarily add this as a job step, either before the | |
| # step of interest without the "if:" line or after the failing step with the | |
| # "if:" line. Then use ssh command printed in CI output. | |
| # - name: Setup tmate session # TEMPORARY! | |
| # if: ${{ failure() }} | |
| # uses: mxschmitt/action-tmate@v3 | |
| # with: | |
| # limit-access-to-actor: true | |
| # ======================== Fast Initial Checks ====================== # | |
| check-format-and-targets: | |
| if: needs.config.outputs.only_job == 'check-format-and-targets' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| with: | |
| fetch-depth: 0 # Need full checkout to determine merge base | |
| fetch-tags: true | |
| - uses: "./.github/actions/setup-upstream" | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| - name: Install Dependencies | |
| run: python -m pip install --upgrade pip | |
| - name: Install argparse | |
| run: pip install argparse | |
| - name: Install clang-format | |
| run: | | |
| pip install https://files.pythonhosted.org/packages/fb/ac/3c04772acc0257f5730e83adb542b2603c1a62d1315010ab593a980af404/clang_format-21.1.2-py2.py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | |
| clang-format --version | |
| - name: Download clang-format-diff.py | |
| 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 | |
| - name: Check format | |
| run: VERBOSE_CHECK=1 make check-format | |
| - name: Compare buckify output | |
| run: make check-buck-targets | |
| - name: Simple source code checks | |
| run: make check-sources | |
| - name: Sanity check check_format_compatible.sh | |
| run: |- | |
| export TEST_TMPDIR=/dev/shm/rocksdb | |
| rm -rf /dev/shm/rocksdb | |
| mkdir /dev/shm/rocksdb | |
| git reset --hard | |
| git config --global --add safe.directory /__w/rocksdb/rocksdb | |
| SANITY_CHECK=1 LONG_TEST=1 tools/check_format_compatible.sh | |
| # ========================= Linux With Tests ======================== # | |
| build-linux: | |
| if: needs.config.outputs.only_job == 'build-linux' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: build-linux | |
| - run: make V=1 J=32 -j32 check | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-cmake-mingw: | |
| if: needs.config.outputs.only_job == 'build-linux-cmake-mingw' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 4-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:24.0 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: cmake-mingw | |
| - run: update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix | |
| - name: Build cmake-mingw | |
| run: |- | |
| export PATH=$JAVA_HOME/bin:$PATH | |
| echo "JAVA_HOME=${JAVA_HOME}" | |
| which java && java -version | |
| which javac && javac -version | |
| 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 | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-make-with-folly: | |
| if: needs.config.outputs.only_job == 'build-linux-make-with-folly' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 32-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/cache-getdeps-downloads" | |
| - uses: "./.github/actions/setup-folly" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: make-with-folly | |
| - uses: "./.github/actions/cache-folly" | |
| id: cache-folly | |
| - uses: "./.github/actions/build-folly" | |
| with: | |
| cache-hit: ${{ steps.cache-folly.outputs.cache-hit }} | |
| - run: USE_FOLLY=1 LIB_MODE=static V=1 make -j64 check | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-make-with-folly-lite-no-test: | |
| if: needs.config.outputs.only_job == 'build-linux-make-with-folly-lite-no-test' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/cache-getdeps-downloads" | |
| - uses: "./.github/actions/setup-folly" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: make-folly-lite | |
| - run: USE_FOLLY_LITE=1 EXTRA_CXXFLAGS=-DGLOG_USE_GLOG_EXPORT V=1 make -j32 all | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-cmake-with-folly-coroutines: | |
| if: needs.config.outputs.only_job == 'build-linux-cmake-with-folly-coroutines' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 32-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/cache-getdeps-downloads" | |
| - uses: "./.github/actions/setup-folly" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: cmake-folly-coroutines | |
| - uses: "./.github/actions/cache-folly" | |
| id: cache-folly | |
| - uses: "./.github/actions/build-folly" | |
| with: | |
| cache-hit: ${{ steps.cache-folly.outputs.cache-hit }} | |
| - run: "(mkdir build && cd build && cmake -DUSE_COROUTINES=1 -DWITH_GFLAGS=1 -DROCKSDB_BUILD_SHARED=0 -DPORTABLE=ON .. && make VERBOSE=1 -j64 && ctest -j64)" | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-cmake-with-benchmark-no-thread-status: | |
| if: needs.config.outputs.only_job == 'build-linux-cmake-with-benchmark-no-thread-status' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: cmake-benchmark | |
| - run: mkdir build && cd build && cmake -DWITH_GFLAGS=1 -DWITH_BENCHMARK=1 -DPORTABLE=ON -DCMAKE_CXX_FLAGS=-DNROCKSDB_THREAD_STATUS .. && make VERBOSE=1 -j20 && ctest -j20 | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-encrypted_env-no_compression: | |
| if: needs.config.outputs.only_job == 'build-linux-encrypted_env-no_compression' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: encrypted-env-no-compression | |
| - 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 | |
| - run: "./sst_dump --help | grep -E -q 'Supported built-in compression types: kNoCompression$' # Verify no compiled in compression\n" | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| # ======================== Linux No Test Runs ======================= # | |
| build-linux-release: | |
| if: needs.config.outputs.only_job == 'build-linux-release' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: release | |
| - run: make V=1 -j32 LIB_MODE=shared release | |
| - run: ls librocksdb.so | |
| - run: "./trace_analyzer --version" # A tool dependent on gflags that can run in release build | |
| - run: make clean | |
| - run: USE_RTTI=1 make V=1 -j32 release | |
| - run: ls librocksdb.a | |
| - run: "./trace_analyzer --version" | |
| - run: make clean | |
| - run: apt-get remove -y libgflags-dev | |
| - run: make V=1 -j32 LIB_MODE=shared release | |
| - run: ls librocksdb.so | |
| - run: if ./trace_analyzer --version; then false; else true; fi | |
| - run: make clean | |
| - run: USE_RTTI=1 make V=1 -j32 release | |
| - run: ls librocksdb.a | |
| - run: if ./trace_analyzer --version; then false; else true; fi | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-clang-13-no_test_run: | |
| if: needs.config.outputs.only_job == 'build-linux-clang-13-no_test_run' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 8-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: clang-13 | |
| # FIXME: get back to "all microbench" targets | |
| - run: CC=clang-13 CXX=clang++-13 USE_CLANG=1 EXTRA_CXXFLAGS=-stdlib=libc++ EXTRA_LDFLAGS=-stdlib=libc++ make -j32 shared_lib | |
| - run: make clean | |
| # FIXME: get back to "release" target | |
| - 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 | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-clang-18-no_test_run: | |
| if: needs.config.outputs.only_job == 'build-linux-clang-18-no_test_run' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:24.0 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: clang-18 | |
| - run: CC=clang-18 CXX=clang++-18 USE_CLANG=1 make -j32 all microbench | |
| - run: make clean | |
| - run: CC=clang-18 CXX=clang++-18 USE_CLANG=1 DEBUG_LEVEL=0 make -j32 release | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-gcc-14-no_test_run: | |
| if: needs.config.outputs.only_job == 'build-linux-gcc-14-no_test_run' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:24.0 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: gcc-14 | |
| - run: CC=gcc-14 CXX=g++-14 V=1 make -j32 all microbench | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| # ======================== Linux Other Checks ======================= # | |
| build-linux-unity-and-headers: | |
| if: needs.config.outputs.only_job == 'build-linux-unity-and-headers' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 4-core-ubuntu | |
| container: | |
| image: gcc:latest | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - run: apt-get update -y && apt-get install -y libgflags-dev | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: unity-headers | |
| - name: Unity build | |
| run: make V=1 -j8 unity_test | |
| - run: make V=1 -j8 -k check-headers | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-mini-crashtest: | |
| if: needs.config.outputs.only_job == 'build-linux-mini-crashtest' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 4-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: mini-crashtest | |
| - 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 | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| # ======================= Linux with Sanitizers ===================== # | |
| build-linux-clang18-asan-ubsan: | |
| if: needs.config.outputs.only_job == 'build-linux-clang18-asan-ubsan' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 32-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:24.0 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: clang18-asan-ubsan | |
| - 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 | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-clang18-mini-tsan: | |
| if: needs.config.outputs.only_job == 'build-linux-clang18-mini-tsan' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 32-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:24.0 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: clang18-tsan | |
| - run: COMPILE_WITH_TSAN=1 CC=clang-18 CXX=clang++-18 ROCKSDB_DISABLE_ALIGNED_NEW=1 USE_CLANG=1 make V=1 -j32 check | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-static_lib-alt_namespace-status_checked: | |
| if: needs.config.outputs.only_job == 'build-linux-static_lib-alt_namespace-status_checked' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 16-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: static-alt-namespace | |
| - 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 | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| # ========================= MacOS build only ======================== # | |
| build-macos: | |
| if: needs.config.outputs.only_job == 'build-macos' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: macos-15-xlarge | |
| env: | |
| ROCKSDB_DISABLE_JEMALLOC: 1 | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: 16.4.0 | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: macos | |
| - uses: "./.github/actions/increase-max-open-files-on-macos" | |
| - uses: "./.github/actions/install-gflags-on-macos" | |
| - uses: "./.github/actions/pre-steps-macos" | |
| - name: Build | |
| run: ulimit -S -n `ulimit -H -n` && make V=1 J=16 -j8 all | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| # ========================= MacOS with Tests ======================== # | |
| build-macos-cmake: | |
| if: needs.config.outputs.only_job == 'build-macos-cmake' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: macos-15-xlarge | |
| strategy: | |
| matrix: | |
| run_sharded_tests: [0, 1, 2, 3] | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: 16.4.0 | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: macos-cmake | |
| - uses: "./.github/actions/increase-max-open-files-on-macos" | |
| - uses: "./.github/actions/install-gflags-on-macos" | |
| - uses: "./.github/actions/pre-steps-macos" | |
| - name: cmake generate project file | |
| run: ulimit -S -n `ulimit -H -n` && mkdir build && cd build && cmake -DWITH_GFLAGS=1 .. | |
| - name: Build tests | |
| run: cd build && make VERBOSE=1 -j8 | |
| - name: Run shard 0 out of 4 test shards | |
| run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 0,,4 | |
| if: ${{ matrix.run_sharded_tests == 0 }} | |
| - name: Run shard 1 out of 4 test shards | |
| run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 1,,4 | |
| if: ${{ matrix.run_sharded_tests == 1 }} | |
| - name: Run shard 2 out of 4 test shards | |
| run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 2,,4 | |
| if: ${{ matrix.run_sharded_tests == 2 }} | |
| - name: Run shard 3 out of 4 test shards | |
| run: ulimit -S -n `ulimit -H -n` && cd build && ctest -j8 -I 3,,4 | |
| if: ${{ matrix.run_sharded_tests == 3 }} | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| # ======================== Windows with Tests ======================= # | |
| # NOTE: some windows jobs are in "nightly" to save resources | |
| build-windows-vs2022: | |
| if: needs.config.outputs.only_job == 'build-windows-vs2022' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: windows-8-core | |
| env: | |
| CMAKE_GENERATOR: Visual Studio 17 2022 | |
| CMAKE_PORTABLE: 1 | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/windows-build-steps" | |
| # ============================ Java Jobs ============================ # | |
| build-linux-java: | |
| if: needs.config.outputs.only_job == 'build-linux-java' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 4-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: java | |
| - name: Set Java Environment | |
| run: |- | |
| echo "JAVA_HOME=${JAVA_HOME}" | |
| which java && java -version | |
| which javac && javac -version | |
| - name: Test RocksDBJava | |
| run: make V=1 J=8 -j8 jtest | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| build-linux-java-static: | |
| if: needs.config.outputs.only_job == 'build-linux-java-static' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 4-core-ubuntu | |
| container: | |
| image: ghcr.io/facebook/rocksdb_ubuntu:22.1 | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: java-static | |
| - name: Set Java Environment | |
| run: |- | |
| echo "JAVA_HOME=${JAVA_HOME}" | |
| which java && java -version | |
| which javac && javac -version | |
| - name: Build RocksDBJava Static Library | |
| run: make V=1 J=8 -j8 rocksdbjavastatic | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| build-macos-java: | |
| if: needs.config.outputs.only_job == 'build-macos-java' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: macos-15-xlarge | |
| env: | |
| JAVA_HOME: "/Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home" | |
| ROCKSDB_DISABLE_JEMALLOC: 1 | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: 16.4.0 | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: macos-java | |
| - uses: "./.github/actions/increase-max-open-files-on-macos" | |
| - uses: "./.github/actions/install-gflags-on-macos" | |
| - uses: "./.github/actions/install-jdk8-on-macos" | |
| - uses: "./.github/actions/pre-steps-macos" | |
| - name: Set Java Environment | |
| run: |- | |
| echo "JAVA_HOME=${JAVA_HOME}" | |
| which java && java -version | |
| which javac && javac -version | |
| - name: Test RocksDBJava | |
| run: make V=1 J=16 -j16 jtest | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-macos-java-static: | |
| if: needs.config.outputs.only_job == 'build-macos-java-static' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: macos-15-xlarge | |
| env: | |
| JAVA_HOME: "/Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home" | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: 16.4.0 | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: macos-java-static | |
| - uses: "./.github/actions/increase-max-open-files-on-macos" | |
| - uses: "./.github/actions/install-gflags-on-macos" | |
| - uses: "./.github/actions/install-jdk8-on-macos" | |
| - uses: "./.github/actions/pre-steps-macos" | |
| - name: Set Java Environment | |
| run: |- | |
| echo "JAVA_HOME=${JAVA_HOME}" | |
| which java && java -version | |
| which javac && javac -version | |
| - name: Build RocksDBJava x86 and ARM Static Libraries | |
| run: make V=1 J=16 -j16 rocksdbjavastaticosx | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-macos-java-static-universal: | |
| if: needs.config.outputs.only_job == 'build-macos-java-static-universal' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: macos-15-xlarge | |
| env: | |
| JAVA_HOME: "/Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home" | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: maxim-lobanov/setup-xcode@v1.6.0 | |
| with: | |
| xcode-version: 16.4.0 | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: macos-java-static-universal | |
| - uses: "./.github/actions/increase-max-open-files-on-macos" | |
| - uses: "./.github/actions/install-gflags-on-macos" | |
| - uses: "./.github/actions/install-jdk8-on-macos" | |
| - uses: "./.github/actions/pre-steps-macos" | |
| - name: Set Java Environment | |
| run: |- | |
| echo "JAVA_HOME=${JAVA_HOME}" | |
| which java && java -version | |
| which javac && javac -version | |
| - name: Build RocksDBJava Universal Binary Static Library | |
| run: make V=1 J=16 -j16 rocksdbjavastaticosx_ub | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" | |
| build-linux-java-pmd: | |
| if: needs.config.outputs.only_job == 'build-linux-java-pmd' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 4-core-ubuntu | |
| container: | |
| image: evolvedbinary/rocksjava:alpine3_x64-be | |
| options: --shm-size=16gb | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/install-maven" | |
| - uses: "./.github/actions/pre-steps" | |
| - name: Set Java Environment | |
| run: |- | |
| echo "JAVA_HOME=${JAVA_HOME}" | |
| which java && java -version | |
| which javac && javac -version | |
| - name: PMD RocksDBJava | |
| run: make V=1 J=8 -j8 jpmd | |
| - uses: actions/upload-artifact@v4.0.0 | |
| with: | |
| name: pmd-report | |
| path: "${{ github.workspace }}/java/target/pmd.xml" | |
| - uses: actions/upload-artifact@v4.0.0 | |
| with: | |
| name: maven-site | |
| path: "${{ github.workspace }}/java/target/site" | |
| build-linux-arm: | |
| if: needs.config.outputs.only_job == 'build-linux-arm' || (needs.config.outputs.only_job == '' && github.repository_owner == 'facebook') | |
| needs: config | |
| runs-on: | |
| labels: 4-core-ubuntu-arm | |
| steps: | |
| - uses: actions/checkout@v4.1.0 | |
| - uses: "./.github/actions/pre-steps" | |
| - run: sudo apt-get update && sudo apt-get install -y build-essential ccache | |
| - uses: "./.github/actions/setup-ccache" | |
| with: | |
| cache-key-prefix: arm | |
| - run: ROCKSDBTESTS_PLATFORM_DEPENDENT=only make V=1 J=4 -j4 all_but_some_tests check_some | |
| - name: Print ccache stats | |
| run: ccache -s | |
| if: always() | |
| shell: bash | |
| - uses: "./.github/actions/post-steps" |