Skip to content

Commit

Permalink
Bump cache
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed Feb 10, 2023
1 parent 8824ecb commit f5e76b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
13 changes: 11 additions & 2 deletions .github/actions/bazel-ci-jammy/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -x
set -e

BAZEL_ARGS=$1
WORKSPACE=$GITHUB_WORKSPACE/gz
WORKSPACE=~/gz
BAZEL_CACHE=$GITHUB_WORKSPACE/bazel_cache
BAZEL=~/.cache/bazelisk-linux-amd64

Expand Down Expand Up @@ -34,6 +34,7 @@ echo ::endgroup::
if [ ! -d "$BAZEL_CACHE" ]; then
mkdir -p ${BAZEL_CACHE}
fi
rm -rf ~/.cache
ln -sf ${BAZEL_CACHE} ~/.cache

# Install baselisk if it is not already installed
Expand All @@ -47,7 +48,7 @@ mkdir -p ${WORKSPACE}/bazel
cd ${WORKSPACE}
shopt -s extglob
# Copy relevant bazel files into the build space
cp -R ${GITHUB_WORKSPACE}/!(gz|.git|.github) ${WORKSPACE}/bazel
cp -R ${GITHUB_WORKSPACE}/!(gz|.git|.github|bazel_cache) ${WORKSPACE}/bazel
vcs import . < ${WORKSPACE}/bazel/example/bazel.repos

echo ::group::Install dependencies from binaries
Expand All @@ -74,3 +75,11 @@ echo ::endgroup::
echo ::group::Bazel test
${BAZEL} test $BAZEL_ARGS
echo ::endgroup::

echo ::group::Bazel test
ls -la ${WORKSPACE}
ls -la ${WORKSPACE}/bazel-testlogs
ls -la ${BAZEL_CACHE}
echo ::endgroup::

cp -RL ${WORKSPACE}/bazel-testlogs ${GITHUB_WORKSPACE}/bazel-testlogs
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Login to GHCR
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Cache bazel
uses: actions/cache@v3
env:
cache-name: bazel-cache-1
cache-name: bazel-cache-3
with:
path: |
${{ github.workspace }}/bazel_cache
Expand All @@ -32,5 +36,5 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: bazel-testlogs
path: ${{ github.workspace }}/gz/bazel-testlogs
path: ${{ github.workspace }}/bazel-testlogs
retention-days: 5

0 comments on commit f5e76b5

Please sign in to comment.