Skip to content

Commit 193acf6

Browse files
committed
[build] log rbe output to an artifact
1 parent dcf9b1f commit 193acf6

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.github/workflows/bazel.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
8484
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
8585
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
BAZEL_LOG_FILE: bazel-logs/bzl_${{ github.run_id }}.log
8687
SE_AVOID_STATS: true
8788
steps:
8889
- name: Checkout source tree

.github/workflows/ci-rbe.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ jobs:
2626
name: All RBE tests
2727
caching: false
2828
ruby-version: jruby-9.4.12.0
29+
upload-name: bazel-logs
30+
upload-path: bazel-logs
2931
run: ./scripts/github-actions/ci-build.sh

scripts/github-actions/ci-build.sh

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,25 @@ set -eufo pipefail
44
# We want to see what's going on
55
set -x
66

7-
# Now run the tests. The engflow build uses pinned browsers
8-
# so this should be fine
9-
# shellcheck disable=SC2046
10-
bazel test --config=remote-ci --build_tests_only \
11-
--keep_going --flaky_test_attempts=2 \
12-
//... -- $(cat .skipped-tests | tr '\n' ' ')
7+
run_bazel_tests() {
8+
# shellcheck disable=SC2046
9+
bazel test --config=remote-ci --build_tests_only \
10+
--keep_going --flaky_test_attempts=2 \
11+
//... -- $(cat .skipped-tests | tr '\n' ' ')
12+
}
13+
14+
# Prepare log directory if BAZEL_LOG_FILE is set and run tests
15+
if [ -n "${BAZEL_LOG_FILE:-}" ]; then
16+
LOG_DIR=$(dirname "$BAZEL_LOG_FILE")
17+
if mkdir -p "$LOG_DIR"; then
18+
run_bazel_tests 2>&1 | tee "$BAZEL_LOG_FILE"
19+
else
20+
echo "Error: Failed to create directory for BAZEL_LOG_FILE" >&2
21+
exit 1
22+
fi
23+
else
24+
run_bazel_tests
25+
fi
1326

1427
# Build the packages we want to ship to users
1528
bazel build --config=remote-ci --build_tag_filters=release-artifact //...

0 commit comments

Comments
 (0)