Skip to content

Commit bd003c5

Browse files
committed
Just: add _if_not_on_ci_just helper, and add generation prerequisites
1 parent 0809715 commit bd003c5

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

misc/just/lib.just

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,16 @@ _run_in DIR +ARGS:
7272
_run_in_semmle_code +ARGS: _require_semmle_code (_run_in "$SEMMLE_CODE" ARGS)
7373

7474
[no-cd, positional-arguments, no-exit-message]
75-
_just +ARGS:
75+
@_just +ARGS:
76+
echo "-> just $@"
7677
"{{ JUST_EXECUTABLE }}" "$@"
7778

79+
[no-cd, positional-arguments]
80+
@_if_not_on_ci_just +ARGS:
81+
if [ "${GITHUB_ACTIONS:-}" != "true" ]; then \
82+
echo "-> just $@"; \
83+
"$JUST_EXECUTABLE" "$@"; \
84+
fi
85+
7886
[no-cd]
7987
_black *ARGS=".": (_run "uv" "run" "black" ARGS)

rust/justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import '../lib.just'
22

33
install: (_bazel "run" "@codeql//rust:install")
44

5-
build: (_build_dist "rust")
5+
build: (_if_not_on_ci_just "generate" source_dir()) (_build_dist "rust")
66

77
generate: (_bazel "run" "@codeql//rust/codegen")
88

rust/ql/integration-tests/justfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import "../../../misc/just/lib.just"
1+
2+
import "../../../lib.just"
23

34

45
[no-cd]
5-
test *ARGS=".": (_just "generate") (_integration_test ARGS)
6+
test *ARGS=".": (_if_not_on_ci_just "generate" source_dir()) (_integration_test ARGS)
67

78
# TODO in separate PR
89
# [no-cd]

0 commit comments

Comments
 (0)