diff --git a/.github/workflows/compute_impacted_tests.yaml b/.github/workflows/compute_impacted_tests.yaml index 3802ec5..c46a9b9 100644 --- a/.github/workflows/compute_impacted_tests.yaml +++ b/.github/workflows/compute_impacted_tests.yaml @@ -29,8 +29,13 @@ jobs: - name: Compute Impacted Targets id: compute - run: ./src/scripts/compute_impacted_targets.sh - shell: bash + uses: trunk-io/breakpoint@v1.3.0 + with: + breakpoint-id: trunk-bazel-action + run: ./src/scripts/compute_impacted_targets.sh + trunk-token: ${{ secrets.TRUNK_DEBUGGER_TOKEN }} + org: trunk-staging-org + shell: bash env: MERGE_INSTANCE_BRANCH: do_not_delete/stable_test_branch MERGE_INSTANCE_BRANCH_HEAD_SHA: 3e8b2a57e0f3ad7b63cc487eae576c25b84b653b @@ -41,6 +46,8 @@ jobs: 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= + TRUNK_API_ADDRESS: api.trunk-staging.io:8443 - name: Validate Impacted Targets Computation shell: bash diff --git a/.trunk/.gitignore b/.trunk/.gitignore index 1e24652..15966d0 100644 --- a/.trunk/.gitignore +++ b/.trunk/.gitignore @@ -6,3 +6,4 @@ plugins user_trunk.yaml user.yaml +tmp diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 30f062e..e3f636a 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -1,14 +1,17 @@ version: 0.1 cli: - version: 1.16.2 + version: 1.21.0 +api: + address: api.trunk-staging.io:8443 + org: trunk-staging-org plugins: sources: - id: trunk - ref: v1.2.5 + ref: v1.4.5 uri: https://github.com/trunk-io/plugins - id: configs uri: https://github.com/trunk-io/configs - ref: v0.0.7 + ref: v1.0.4 runtimes: enabled: - node@18.12.1 diff --git a/action.yaml b/action.yaml index 70d4379..e950ad5 100644 --- a/action.yaml +++ b/action.yaml @@ -50,6 +50,10 @@ inputs: description: The command to run against bazel when running tests. required: false default: test + bazel-diff-command-options: + description: Additional args to append to the bazel diff bazelCommandOptions flag. + required: false + default: "" test-kind-filter: description: Kind filter to apply to impacted targets required: false @@ -136,6 +140,7 @@ runs: WORKSPACE_PATH: ${{ steps.prerequisites.outputs.workspace_path }} BAZEL_PATH: ${{ inputs.bazel-path }} BAZEL_DIFF_CMD: ${{ steps.bazel-diff.outputs.bazel_diff_cmd }} + BAZEL_DIFF_COMMAND_OPTIONS: ${{ inputs.bazel-diff-command-options }} BAZEL_STARTUP_OPTIONS: ${{ inputs.bazel-startup-options }} - name: Upload Impacted Targets @@ -170,6 +175,7 @@ runs: WORKSPACE_PATH: ${{ steps.prerequisites.outputs.workspace_path }} BAZEL_PATH: ${{ inputs.bazel-path }} BAZEL_DIFF_CMD: ${{ steps.bazel-diff.outputs.bazel_diff_cmd }} + BAZEL_DIFF_COMMAND_OPTIONS: ${{ inputs.bazel-diff-command-options }} BAZEL_STARTUP_OPTIONS: ${{ inputs.bazel-startup-options }} - name: Test Impacted Targets diff --git a/src/scripts/compute_impacted_targets.sh b/src/scripts/compute_impacted_targets.sh index 21623f2..ace87cc 100755 --- a/src/scripts/compute_impacted_targets.sh +++ b/src/scripts/compute_impacted_targets.sh @@ -78,7 +78,7 @@ generate_hashes() { --bazelPath "${BAZEL_PATH}" \ -so="${bazel_startup_options}" \ --workspacePath "${WORKSPACE_PATH}" \ - --bazelCommandOptions "--noshow_progress" \ + --bazelCommandOptions "--noshow_progress ${BAZEL_DIFF_COMMAND_OPTIONS}" \ "$1" } diff --git a/src/scripts/test_wrapper.sh b/src/scripts/test_wrapper.sh index cc5aee0..2ad1e37 100755 --- a/src/scripts/test_wrapper.sh +++ b/src/scripts/test_wrapper.sh @@ -18,6 +18,7 @@ TARGET_BRANCH=main BAZEL_PATH="${BAZEL_PATH:-.trunk/tools/bazel}" CACHE_DIR="${HOME}/.cache/trunk/bazel-diff" BAZEL_STARTUP_OPTIONS="" +BAZEL_DIFF_COMMAND_OPTIONS="" mkdir -p "${CACHE_DIR}"