[cicd] try to fix bazel cache #63
Workflow file for this run
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: test-opensrc | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ "ci/direct-cache" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| unit_test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/alibaba/tair-kvcache-kvcm-dev:2026_02_03_13_26_feea140 | |
| volumes: | |
| - /host_root/:/ | |
| steps: | |
| # https://github.com/actions/runner-images/issues/2840 | |
| # https://github.com/korjavin/haskel-web1/commit/3bd3d2a74c41418ec31a8bec34dcd9c100f4e22d | |
| - name: Free up disk space | |
| run: | | |
| echo "Disk space before cleanup:" | |
| df -h | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| echo "Disk space after cleanup:" | |
| df -h | |
| - uses: actions/checkout@v4 | |
| - uses: bazel-contrib/setup-bazel@0.18.0 | |
| with: | |
| bazelisk-cache: true | |
| disk-cache: false | |
| repository-cache: true | |
| cache-save: false | |
| - name: bazel_test | |
| run: | | |
| set -x | |
| set -e | |
| du -h -d 3 /${HOME}/.cache/ | |
| df -h | |
| bazelisk test //kv_cache_manager/... --cache_test_results=no --test_output=errors --jobs=4 | |
| ls -alh ./ | |
| du -h -d 3 /${HOME}/.cache/ | |
| du -h -d 3 /${HOME}/.bazel/ | |
| df -h | |
| du -h -d 3 / | |
| - name: create_archive | |
| if: failure() | |
| run: | | |
| set -x | |
| set -e | |
| test -a bazel-out.tar && rm -f bazel-out.tar | |
| find bazel-out/k8-opt/bin/ '(' -name 'kv_cache_manager.log' -o -name 'access.log' -o -name 'metrics.log' -o -name 'stdout' -o -name 'stderr' ')' -a -exec 'tar' '-r' '-f' 'bazel-out.tar' '{}' ';' | |
| find bazel-out/k8-opt/bin/ -name 'core-*' -a -type f -a -exec 'tar' '-r' '-f' 'bazel-out.tar' '{}' ';' | |
| tar -r -f bazel-out.tar bazel-out/k8-opt/testlogs/ | |
| gzip -f bazel-out.tar | |
| - uses: actions/upload-artifact@v6 | |
| if: failure() | |
| with: | |
| name: unit_test-bazel-out.tar.gz | |
| path: ./bazel-out.tar.gz | |
| overwrite: true | |
| # integration_test: | |
| # runs-on: ubuntu-latest | |
| # container: | |
| # image: ghcr.io/alibaba/tair-kvcache-kvcm-dev:2026_02_03_13_26_feea140 | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - name: Restore cache | |
| # id: cache-restore | |
| # uses: actions/cache/restore@v5 | |
| # with: | |
| # path: | | |
| # /root/.cache/ | |
| # key: ${{ runner.os }}-unittest-cache | |
| # - uses: bazel-contrib/setup-bazel@0.18.0 | |
| # with: | |
| # bazelisk-cache: true | |
| # disk-cache: ${{ runner.os }}-${{ github.workflow }}-integration_test | |
| # repository-cache: true | |
| # cache-save: ${{ github.event_name != 'pull_request' }} | |
| # - name: bazel_test | |
| # run: | | |
| # set -x | |
| # set -e | |
| # du -h -d 3 /${HOME}/.cache/ | |
| # df -h | |
| # bazelisk test //integration_test/... --cache_test_results=no --test_output=errors | |
| # ls -alh ./ | |
| # du -h -d 3 /${HOME}/.cache/ | |
| # df -h | |
| # - name: Save cache | |
| # id: cache-restore | |
| # if: ${{ github.event_name != 'pull_request' }} | |
| # uses: actions/cache/save@v5 | |
| # with: | |
| # path: | | |
| # /root/.cache/ | |
| # key: ${{ runner.os }}-unittest-cache | |
| # - name: create_archive | |
| # if: failure() | |
| # run: | | |
| # set -x | |
| # set -e | |
| # test -a bazel-out.tar && rm -f bazel-out.tar | |
| # find bazel-out/k8-opt/bin/ '(' -name 'kv_cache_manager.log' -o -name 'access.log' -o -name 'metrics.log' -o -name 'stdout' -o -name 'stderr' ')' -a -exec 'tar' '-r' '-f' 'bazel-out.tar' '{}' ';' | |
| # find bazel-out/k8-opt/bin/ -name 'core-*' -a -type f -a -exec 'tar' '-r' '-f' 'bazel-out.tar' '{}' ';' | |
| # tar -r -f bazel-out.tar bazel-out/k8-opt/testlogs/ | |
| # gzip -f bazel-out.tar | |
| # - uses: actions/upload-artifact@v6 | |
| # if: failure() | |
| # with: | |
| # name: integration_test-bazel-out.tar.gz | |
| # path: ./bazel-out.tar.gz | |
| # overwrite: true |