Skip to content

Commit

Permalink
Check that the cli can compile with --warnings-as-errors in ci
Browse files Browse the repository at this point in the history
It's technically a build target, so we didn't need to create a whole
new test rule, but it's marked as "manual" so that it doesn't cause
bazel build //... to fail

(cherry picked from commit f2add66)
  • Loading branch information
HoloRin authored and mergify[bot] committed Jun 19, 2024
1 parent 2287a84 commit 7e8c959
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ jobs:
cat << EOF >> user.bazelrc
build --strategy=TestRunner=local
EOF
- name: CLI COMPILE WARNINGS AS ERRORS
if: inputs.plugin == 'rabbitmq_cli'
run: |
bazel build //deps/rabbitmq_cli:compile_warnings_as_errors \
--verbose_failures
- name: COMPUTE TESTS IN SHARD
id: shard
run: |
Expand Down
31 changes: 31 additions & 0 deletions deps/rabbitmq_cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,34 @@ test_suite(
name = "rabbitmqctl_tests",
tests = ["tests"],
)

elixir_bytecode(
name = "compile_warnings_as_errors",
srcs = SRCS,
dest = "beam_files_werror",
elixirc_opts = [
"--warnings-as-errors",
"-e",
":application.ensure_all_started(:mix)",
],
env = {
"HOME": '"$(mktemp -d)"',
"MIX_ENV": "prod",
"DEPS_DIR": "$ERL_LIBS",
"ERL_COMPILER_OPTIONS": "deterministic",
"LANG": "en_US.UTF-8",
"LC_ALL": "en_US.UTF-8",
},
ez_deps = [
":csv.ez",
":json.ez",
],
setup = """\
mkdir -p _build/$MIX_ENV/lib/csv
cp -RL $ERL_LIBS/csv/ebin _build/$MIX_ENV/lib/csv
""",
deps = DEPS + [
"//deps/rabbit:erlang_app",
],
tags = ["manual"],
)

0 comments on commit 7e8c959

Please sign in to comment.