Skip to content

Commit

Permalink
chore: update to use tweag/configure-bazel-remote-cache-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrindel committed Nov 27, 2023
1 parent 7059b07 commit b8291b1
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ jobs:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
extra-substituters = https://cache.iog.io
# DO NOT MERGE!!!
# TODO: Update with the correct tagged release.
- uses: tweag/configure-bazel-remote-cache-auth@fix_output
with:
buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }}
bazelrc_path: .bazelrc.local
- name: Configure
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
run: |
# Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
# See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
Expand All @@ -61,15 +65,9 @@ jobs:
macOS) BUILD_CONFIG=ci-macos-nixpkgs;;
Linux) BUILD_CONFIG=ci-linux-nixpkgs;;
esac
if [ -z "$BUILDBUDDY_API_KEY" ]; then
cache_setting='--noremote_upload_local_results'
else
cache_setting="--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
fi
cat >.bazelrc.local <<EOF
cat >>.bazelrc.local <<EOF
common --config=ci
build --config=$BUILD_CONFIG
build $cache_setting
common --enable_bzlmod=${{ matrix.bzlmod }}
EOF
cp .bazelrc.local rules_haskell_nix
Expand Down Expand Up @@ -160,9 +158,13 @@ jobs:
BAZEL_DIR="$(.ci/fetch-bazel-bindist)"
mv $BAZEL_DIR $HOME/bazel
echo "$HOME/bazel" >> "$GITHUB_PATH"
# DO NOT MERGE!!!
# TODO: Update with the correct tagged release.
- uses: tweag/configure-bazel-remote-cache-auth@fix_output
with:
buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }}
bazelrc_path: .bazelrc.local
- name: Configure
env:
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
shell: bash
run: |
# Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
Expand All @@ -174,11 +176,6 @@ jobs:
Windows,rules_haskell) BUILD_CONFIG=ci-windows-bindist-rules-haskell;;
Windows,rules_haskell_tests) BUILD_CONFIG=ci-windows-bindist-rules-haskell-tests;;
esac
if [ -z "$BUILDBUDDY_API_KEY" ]; then
cache_setting='--noremote_upload_local_results'
else
cache_setting="--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
fi
if [[ ${{ runner.os }} == Windows ]]; then
output_root_setting="startup --output_user_root=C:/_bzl"
# On windows, we use a separate remote cache for bzlmod,
Expand All @@ -192,10 +189,9 @@ jobs:
output_root_setting=""
bzlmod_cache_silo_key=""
fi
cat >.bazelrc.local <<EOF
cat >>.bazelrc.local <<EOF
common --config=ci
build --config=$BUILD_CONFIG
build $cache_setting
$output_root_setting
$bzlmod_cache_silo_key
common --enable_bzlmod=${{ matrix.bzlmod }}
Expand Down

0 comments on commit b8291b1

Please sign in to comment.