Skip to content

Commit

Permalink
[ci] Update github caching to be more similar to drake-blender
Browse files Browse the repository at this point in the history
- Ensure we use changing cache keys s.t. we actually update the cache
- Update caching paths
  • Loading branch information
EricCousineau-TRI committed Aug 16, 2023
1 parent 381424a commit 9320a15
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
16 changes: 9 additions & 7 deletions .github/ci.bazelrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# This is symlinked by `./workflows/bazelized*.yml` actions in order to alter
# Bazel's configuration for CI. This is similar to Drake's CI configuration:
# https://github.com/RobotLocomotion/drake-ci/blob/0f2c2158/user.bazelrc#L42
# Bazel's configuration for CI. This is similar to drake-blender's CI
# configuration:
# https://github.com/RobotLocomotion/drake-blender/blob/c4a33f80/.github/ci.bazelrc

# Dump configuration details to the log.
common --announce_rc=yes

common --experimental_ui_max_stdouterr_bytes=5242880
common --keep_going=yes

test --test_summary=short

# Paths for caching Bazel externals and disk cache.
fetch --repository_cache /home/runner/.cache/ci/bazel_externals
build --repository_cache /home/runner/.cache/ci/bazel_externals
fetch --disk_cache /home/runner/.cache/ci/bazel_local_disk
build --disk_cache /home/runner/.cache/ci/bazel_local_disk
fetch --repository_cache /home/runner/.cache/bazel_ci/bazel_externals
build --repository_cache /home/runner/.cache/bazel_ci/bazel_externals
fetch --disk_cache /home/runner/.cache/bazel_ci/bazel_local_disk
build --disk_cache /home/runner/.cache/bazel_ci/bazel_local_disk
18 changes: 14 additions & 4 deletions .github/workflows/bazelized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@ jobs:
# See https://stackoverflow.com/a/73613377/7829525
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Caching.
# See comments in drake-blender for more details:
# https://github.com/RobotLocomotion/drake-blender/blob/c4a33f80/.github/workflows/main.yml
- uses: actions/cache@v3
with:
path: "/home/runner/.cache/ci"
key: bazel
path: "/home/runner/.cache/bazel_ci"
# We want this key to change to ensure we store the updated cache.
key: bazel_ci-${{ github.ref }}-${{ github.run_number }}-${{ github.run_attempt }}
restore-keys: |
bazel_ci-${{ github.ref }}-
bazel_ci-refs/heads/main-
- name: Check cache
run: du -hs $(readlink -f /home/runner/.cache/ci)
run: du -hs $(readlink -f /home/runner/.cache/bazel_ci) || true

# Setup.
- name: Simplify apt upgrades
run: .github/simplify_apt_and_upgrades.sh
- name: Configure Bazel for CI (bazel_ros2_rules)
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/bazelized_drake_ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@ jobs:
if: "! contains(github.event.pull_request.labels.*.name, 'status: defer ci')"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Caching.
# See comments in drake-blender for more details:
# https://github.com/RobotLocomotion/drake-blender/blob/c4a33f80/.github/workflows/main.yml
- uses: actions/cache@v3
with:
path: "/home/runner/.cache/ci"
key: bazel
path: "/home/runner/.cache/bazel_ci"
# We want this key to change to ensure we store the updated cache.
key: bazel_ci-${{ github.ref }}-${{ github.run_number }}-${{ github.run_attempt }}
restore-keys: |
bazel_ci-${{ github.ref }}-
bazel_ci-refs/heads/main-
- name: Check cache
run: du -hs $(readlink -f /home/runner/.cache/ci)
run: du -hs $(readlink -f /home/runner/.cache/bazel_ci) || true

# Setup.
- name: Simplify apt upgrades
run: .github/simplify_apt_and_upgrades.sh
- name: Configure drake_ros Bazel for CI
Expand Down

0 comments on commit 9320a15

Please sign in to comment.