Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/bazelrc-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -e -o pipefail -o nounset

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 <<EOF
common --config=ci
build --build_metadata=REPO_URL=${GITHUB_REPOSITORY}
build --build_metadata=BRANCH_NAME=${GITHUB_REF_NAME}
build --build_metadata=COMMIT_SHA=${GITHUB_SHA}
build:ci --build_metadata=ROLE=CI
build $cache_setting
EOF
4 changes: 2 additions & 2 deletions .github/workflows/patch-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
Linux) BUILD_CONFIG=ci-linux-bindist;;
Windows) BUILD_CONFIG=ci-windows-bindist;;
esac
.github/workflows/bazelrc-config.sh >.bazelrc.ci
cat >.bazelrc.local <<EOF
common --config=ci
build --config=$BUILD_CONFIG
build --remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY"
import %workspace%/.bazelrc.ci
EOF
cat >~/.netrc <<EOF
machine api.github.com
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
macOS) BUILD_CONFIG=ci-macos-nixpkgs;;
Linux) BUILD_CONFIG=ci-linux-nixpkgs;;
esac
.github/workflows/bazelrc-config.sh >.bazelrc.ci
cat >.bazelrc.local <<EOF
common --config=ci
build --config=$BUILD_CONFIG
build --remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY"
import %workspace%/.bazelrc.ci
EOF
cat >~/.netrc <<EOF
machine api.github.com
Expand Down Expand Up @@ -88,15 +88,10 @@ jobs:
# 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.
sudo sysctl -w net.ipv4.tcp_keepalive_time=60
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
.github/workflows/bazelrc-config.sh >.bazelrc.ci
cat >.bazelrc.local <<EOF
common --config=ci
build --config=linux-nixpkgs
build $cache_setting
import %workspace%/.bazelrc.ci
EOF
ln -sr .bazelrc.local examples/arm/.bazelrc.local
cat >~/.netrc <<EOF
Expand Down Expand Up @@ -151,15 +146,10 @@ jobs:
Linux) BUILD_CONFIG=ci-linux-bindist;;
Windows) BUILD_CONFIG=ci-windows-bindist;;
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
.github/workflows/bazelrc-config.sh >.bazelrc.ci
cat >.bazelrc.local <<EOF
common --config=ci
build --config=$BUILD_CONFIG
build $cache_setting
import %workspace%/.bazelrc.ci
EOF
cat >~/.netrc <<EOF
machine api.github.com
Expand Down
15 changes: 0 additions & 15 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -489,21 +489,6 @@ haskell_package_repository_dummy(
name = "haskell_package_repository_dummy",
)

http_archive(
name = "io_bazel_rules_sass",
sha256 = "53b42e9dc1c12d18716518a3810780a0131cd513a6d5c828e1eb3fbd30cc0ba6",
strip_prefix = "rules_sass-1.44.0",
urls = ["https://github.com/bazelbuild/rules_sass/archive/1.44.0.tar.gz"],
)

load("@io_bazel_rules_sass//:package.bzl", "rules_sass_dependencies")

rules_sass_dependencies()

load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")

sass_repositories()

http_archive(
name = "io_bazel_stardoc",
sha256 = "c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72",
Expand Down
2 changes: 2 additions & 0 deletions tests/run-start-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ case "$OSTYPE" in
;;
esac

cp "${pwd}/.bazelrc.ci" .bazelrc.local

NIX_PATH=nixpkgs="$pwd/nixpkgs/default.nix" \
bazel run \
--config=ci "${OSCONFIG[@]}" \
Expand Down