Skip to content

Commit 6535745

Browse files
l46kokcopybara-github
authored andcommitted
Add a workflow for checking unwanted @cel_spec dep in the runtime
PiperOrigin-RevId: 706808141
1 parent 692b009 commit 6535745

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/unwanted_deps.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# Copyright 2024 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Script ran as part of Github CEL-Java CI to verify that the runtime jar does not contain generated cel protos from @cel_spec.
17+
18+
runtime_deps="$(bazel query 'deps(//publish:cel_runtime)' --nohost_deps --noimplicit_deps --output graph | grep '@cel_spec')"
19+
20+
if [[ ! -z $runtime_deps ]]; then
21+
echo -e "Runtime contains unwanted @cel_spec dependency!\n"
22+
echo "cel_spec dependency graph:"
23+
echo -e "$runtime_deps"
24+
exit 1
25+
fi
26+
27+
exit 0
28+

.github/workflows/workflow.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ jobs:
3535
# Exclude codelab exercises as they are intentionally made to fail
3636
# Exclude conformance tests for time being until TextFormat.Parser fix is in upstream
3737
run: bazelisk test ... --deleted_packages=//codelab/src/test/codelab,//conformance/src/test/java/dev/cel/conformance --test_output=errors
38+
- name: Unwanted Dependencies
39+
run: .github/workflows/unwanted_deps.sh
3840
- run: echo "🍏 This job's status is ${{ job.status }}."

0 commit comments

Comments
 (0)