Skip to content

Commit

Permalink
[ci] Address @bitstreams//BUILD.bazel nullifying action cache
Browse files Browse the repository at this point in the history
Place bitstreams from other jobs in a consistent location, so the
BUILD.bazel file and the command line for the action are not needlessly
changed for every CI run.

Originally, the git revision would be part of the path name to source
files, and this precluded any possibility of getting a hit to the action
cache.

Signed-off-by: Alexander Williams <[email protected]>
  • Loading branch information
a-will committed Nov 10, 2023
1 parent cc2e65c commit 45e9591
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ci/scripts/run-fpga-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ set -e

. util/build_consts.sh

SHA=$(git rev-parse HEAD)
readonly SHA

if [ $# == 0 ]; then
echo >&2 "Usage: run-fpga-tests.sh <fpga> <tags>"
echo >&2 "E.g. ./run-fpga-tests.sh cw310 cw310_rom"
Expand All @@ -23,7 +20,7 @@ fpga_tags=("$@")

# Copy bitstreams and related files into the cache directory so Bazel will have
# the corresponding targets in the @bitstreams workspace.
readonly BIT_CACHE_DIR="${HOME}/.cache/opentitan-bitstreams/cache/${SHA}"
readonly BIT_CACHE_DIR="${HOME}/.cache/opentitan-bitstreams/cache/ci_bitstreams"
if [ "${fpga}" = "hyper310" ]; then
readonly BIT_SRC_DIR="${BIN_DIR}/hw/top_earlgrey/chip_earlgrey_cw310_hyperdebug"
else
Expand All @@ -32,8 +29,7 @@ fi
mkdir -p "${BIT_CACHE_DIR}"
cp -rt "${BIT_CACHE_DIR}" "${BIT_SRC_DIR}"/*

echo -n "$SHA" > "${BIT_CACHE_DIR}/../../latest.txt"
export BITSTREAM="--offline --list ${SHA}"
export BITSTREAM="--offline --list ci_bitstreams"

# We will lose serial access when we reboot, but if tests fail we should reboot
# in case we've crashed the UART handler on the CW310's SAM3U
Expand Down

0 comments on commit 45e9591

Please sign in to comment.