Skip to content

Add support for submodules #125

Add support for submodules

Add support for submodules #125

name: Pull Request
on: pull_request
permissions: read-all
jobs:
tests_compute_targets:
runs-on: ubuntu-latest
name: Compute Impacted Targets Tests
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Bazel
# trunk-ignore(semgrep): Trust third-party `bazelbuild` GH Action
uses: bazelbuild/setup-bazelisk@v2
- name: Setup Bazel Diff
id: bazel-diff
working-directory: ./tests/simple_bazel_workspace
shell: bash
run: |
_java=$(bazel info java-home)/bin/java
curl --retry 5 -Lo bazel-diff.jar https://github.com/Tinder/bazel-diff/releases/latest/download/bazel-diff_deploy.jar
"${_java}" -jar bazel-diff.jar -V
echo "bazel_diff_cmd=${_java} -jar ./tests/simple_bazel_workspace/bazel-diff.jar" >>"${GITHUB_OUTPUT}"
- name: Compute Impacted Targets
id: compute
run: ./src/scripts/compute_impacted_targets.sh
shell: bash
env:
MERGE_INSTANCE_BRANCH: do_not_delete/stable_test_branch
MERGE_INSTANCE_BRANCH_HEAD_SHA: 3e8b2a57e0f3ad7b63cc487eae576c25b84b653b
PR_BRANCH: do_not_delete/stable_test_branch
PR_BRANCH_HEAD_SHA: 3e8b2a57e0f3ad7b63cc487eae576c25b84b653b
VERBOSE: 1
WORKSPACE_PATH: ./tests/simple_bazel_workspace
BAZEL_STARTUP_OPTIONS: --host_jvm_args=-Xmx12G,--block_for_lock,--client_debug
BAZEL_PATH: bazel
BAZEL_DIFF_CMD: ${{ steps.bazel-diff.outputs.bazel_diff_cmd }}
BAZEL_DIFF_COMMAND_OPTIONS: --remote_cache=
- name: Validate Impacted Targets Computation
shell: bash
run: |
target_count=`cat ${{ steps.compute.outputs.impacted_targets_out }} | wc -l`
if [[ $target_count -ne 0 ]]; then
exit 1
fi