Just: add _if_not_on_ci_just helper, and add generation prerequisites

This commit is contained in:
Paolo Tranquilli
2025-07-08 17:22:27 +02:00
parent 08097157fd
commit bd003c58a8
3 changed files with 13 additions and 4 deletions

View File

@@ -72,8 +72,16 @@ _run_in DIR +ARGS:
_run_in_semmle_code +ARGS: _require_semmle_code (_run_in "$SEMMLE_CODE" ARGS)
[no-cd, positional-arguments, no-exit-message]
_just +ARGS:
@_just +ARGS:
echo "-> just $@"
"{{ JUST_EXECUTABLE }}" "$@"
[no-cd, positional-arguments]
@_if_not_on_ci_just +ARGS:
if [ "${GITHUB_ACTIONS:-}" != "true" ]; then \
echo "-> just $@"; \
"$JUST_EXECUTABLE" "$@"; \
fi
[no-cd]
_black *ARGS=".": (_run "uv" "run" "black" ARGS)

View File

@@ -2,7 +2,7 @@ import '../lib.just'
install: (_bazel "run" "@codeql//rust:install")
build: (_build_dist "rust")
build: (_if_not_on_ci_just "generate" source_dir()) (_build_dist "rust")
generate: (_bazel "run" "@codeql//rust/codegen")

View File

@@ -1,8 +1,9 @@
import "../../../misc/just/lib.just"
import "../../../lib.just"
[no-cd]
test *ARGS=".": (_just "generate") (_integration_test ARGS)
test *ARGS=".": (_if_not_on_ci_just "generate" source_dir()) (_integration_test ARGS)
# TODO in separate PR
# [no-cd]