mirror of
https://github.com/openai/codex.git
synced 2026-05-02 18:37:01 +00:00
ci: align just bazel helpers with workflow behavior
This commit is contained in:
31
.github/scripts/run-bazel-ci.sh
vendored
31
.github/scripts/run-bazel-ci.sh
vendored
@@ -41,8 +41,23 @@ if [[ -n "${BAZEL_OUTPUT_USER_ROOT:-}" ]]; then
|
|||||||
bazel_startup_args+=("--output_user_root=${BAZEL_OUTPUT_USER_ROOT}")
|
bazel_startup_args+=("--output_user_root=${BAZEL_OUTPUT_USER_ROOT}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
runner_os="${RUNNER_OS:-}"
|
||||||
|
if [[ -z "${runner_os}" ]]; then
|
||||||
|
case "$(uname -s)" in
|
||||||
|
Darwin)
|
||||||
|
runner_os=macOS
|
||||||
|
;;
|
||||||
|
Linux)
|
||||||
|
runner_os=Linux
|
||||||
|
;;
|
||||||
|
MINGW*|MSYS*|CYGWIN*)
|
||||||
|
runner_os=Windows
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
ci_config=ci-linux
|
ci_config=ci-linux
|
||||||
case "${RUNNER_OS:-}" in
|
case "${runner_os}" in
|
||||||
macOS)
|
macOS)
|
||||||
ci_config=ci-macos
|
ci_config=ci-macos
|
||||||
;;
|
;;
|
||||||
@@ -112,7 +127,7 @@ if [[ ${#bazel_args[@]} -eq 0 || ${#bazel_targets[@]} -eq 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $use_node_test_env -eq 1 && "${RUNNER_OS:-}" != "Windows" ]]; then
|
if [[ $use_node_test_env -eq 1 && "${runner_os}" != "Windows" ]]; then
|
||||||
# Bazel test sandboxes on macOS may resolve an older Homebrew `node`
|
# Bazel test sandboxes on macOS may resolve an older Homebrew `node`
|
||||||
# before the `actions/setup-node` runtime on PATH.
|
# before the `actions/setup-node` runtime on PATH.
|
||||||
node_bin="$(which node)"
|
node_bin="$(which node)"
|
||||||
@@ -158,7 +173,10 @@ if [[ -n "${BUILDBUDDY_API_KEY:-}" ]]; then
|
|||||||
bazel_status=${PIPESTATUS[0]}
|
bazel_status=${PIPESTATUS[0]}
|
||||||
set -e
|
set -e
|
||||||
else
|
else
|
||||||
echo "BuildBuddy API key is not available; using local Bazel configuration."
|
bazel_run_args=("${bazel_args[@]}")
|
||||||
|
|
||||||
|
if [[ -n "${GITHUB_ACTIONS:-}" ]]; then
|
||||||
|
echo "BuildBuddy API key is not available in GitHub Actions; disabling remote Bazel services."
|
||||||
# Keep fork/community PRs on Bazel but disable remote services that are
|
# Keep fork/community PRs on Bazel but disable remote services that are
|
||||||
# configured in .bazelrc and require auth.
|
# configured in .bazelrc and require auth.
|
||||||
#
|
#
|
||||||
@@ -175,11 +193,14 @@ else
|
|||||||
# clear remote cache/execution endpoints configured in .bazelrc.
|
# clear remote cache/execution endpoints configured in .bazelrc.
|
||||||
# https://bazel.build/reference/command-line-reference#common_options-flag--remote_cache
|
# https://bazel.build/reference/command-line-reference#common_options-flag--remote_cache
|
||||||
# https://bazel.build/reference/command-line-reference#common_options-flag--remote_executor
|
# https://bazel.build/reference/command-line-reference#common_options-flag--remote_executor
|
||||||
bazel_run_args=(
|
bazel_run_args+=(
|
||||||
"${bazel_args[@]}"
|
|
||||||
--remote_cache=
|
--remote_cache=
|
||||||
--remote_executor=
|
--remote_executor=
|
||||||
)
|
)
|
||||||
|
else
|
||||||
|
echo "BuildBuddy API key env var is not available; preserving Bazel remote settings from local Bazel config."
|
||||||
|
fi
|
||||||
|
|
||||||
if (( ${#post_config_bazel_args[@]} > 0 )); then
|
if (( ${#post_config_bazel_args[@]} > 0 )); then
|
||||||
bazel_run_args+=("${post_config_bazel_args[@]}")
|
bazel_run_args+=("${post_config_bazel_args[@]}")
|
||||||
fi
|
fi
|
||||||
|
|||||||
9
justfile
9
justfile
@@ -67,17 +67,18 @@ bazel-lock-check:
|
|||||||
./scripts/check-module-bazel-lock.sh
|
./scripts/check-module-bazel-lock.sh
|
||||||
|
|
||||||
bazel-test:
|
bazel-test:
|
||||||
bazel test --test_tag_filters=-argument-comment-lint //... --keep_going
|
bazel test --test_tag_filters=-argument-comment-lint --keep_going -- //... -//third_party/v8:all
|
||||||
|
|
||||||
bazel-clippy:
|
bazel-clippy:
|
||||||
bazel build --config=clippy -- //codex-rs/... -//codex-rs/v8-poc:all
|
bazel build --config=clippy -- //codex-rs/... -//codex-rs/v8-poc:all
|
||||||
|
|
||||||
[no-cd]
|
[no-cd]
|
||||||
bazel-argument-comment-lint:
|
bazel-argument-comment-lint:
|
||||||
bazel build --config=argument-comment-lint -- //codex-rs/...
|
./.github/scripts/run-bazel-ci.sh -- build --config=argument-comment-lint --keep_going -- //codex-rs/...
|
||||||
|
|
||||||
|
[no-cd]
|
||||||
bazel-remote-test:
|
bazel-remote-test:
|
||||||
bazel test --test_tag_filters=-argument-comment-lint //... --config=remote --platforms=//:rbe --keep_going
|
./.github/scripts/run-bazel-ci.sh --print-failed-test-logs --use-node-test-env -- test --test_tag_filters=-argument-comment-lint --test_verbose_timeout_warnings -- //... -//third_party/v8:all
|
||||||
|
|
||||||
build-for-release:
|
build-for-release:
|
||||||
bazel build //codex-rs/cli:release_binaries --config=remote
|
bazel build //codex-rs/cli:release_binaries --config=remote
|
||||||
@@ -102,7 +103,7 @@ write-hooks-schema:
|
|||||||
[no-cd]
|
[no-cd]
|
||||||
argument-comment-lint *args:
|
argument-comment-lint *args:
|
||||||
if [ "$#" -eq 0 ]; then \
|
if [ "$#" -eq 0 ]; then \
|
||||||
bazel build --config=argument-comment-lint -- //codex-rs/...; \
|
./.github/scripts/run-bazel-ci.sh -- build --config=argument-comment-lint --keep_going -- //codex-rs/...; \
|
||||||
else \
|
else \
|
||||||
./tools/argument-comment-lint/run-prebuilt-linter.py "$@"; \
|
./tools/argument-comment-lint/run-prebuilt-linter.py "$@"; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user