-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (46 loc) · 1.84 KB
/
compute_impacted_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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