Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Ci Debugger in bazel action #17

Merged
merged 12 commits into from
Feb 7, 2024
33 changes: 32 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ inputs:
test-negative-tag-filter:
description: Negative tag filter to apply to impacted targets
required: false
enable-trunk-ci-debugger:
description: Enable support for the Trunk ci debugger (https://docs.trunk.io/ci-debugger)
required: false
default: false
trunk-ci-debugger-breakpoint-name:
description: Name of the trunk breakpoint to apply
required: false
default: my-breakpoint

runs:
using: composite
Expand Down Expand Up @@ -165,7 +173,7 @@ runs:
BAZEL_STARTUP_OPTIONS: ${{ inputs.bazel-startup-options }}

- name: Test Impacted Targets
if: inputs.test-targets == 'true'
if: inputs.test-targets == 'true' && !inputs.enable-trunk-ci-debugger
id: test-impacted-targets
run: ${GITHUB_ACTION_PATH}/src/scripts/test_impacted_targets.sh
working-directory: ${{ steps.prerequisites.outputs.workspace_path }}
Expand All @@ -182,3 +190,26 @@ runs:
BAZEL_NEGATIVE_SCOPE_FILTER: ${{ inputs.test-negative-scope-filter }}
BAZEL_NEGATIVE_TAG_FILTER: ${{ inputs.test-negative-tag-filter }}
CI: "true"

- name: Test Impacted Targets (with debugger)
if: inputs.test-targets == 'true' && inputs.enable-trunk-ci-debugger
id: test-impacted-targets-dbg
uses: trunk-io/breakpoint@v1
with:
breakpoint-id: ${{ inputs.trunk-ci-debugger-breakpoint-name }}
trunk-token: ${{ env.TRUNK_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we usually specify to use this from secrets.?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but an action can't access secrets from the og repo, maybe I'll just add it as in input

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually completely missed that the action already takes a token as an input, modified

run: ${{ github.action_path }}/src/scripts/test_impacted_targets.sh
working-directory: ${{ steps.prerequisites.outputs.workspace_path }}
shell: bash
env:
IMPACTED_TARGETS_FILE:
${{ steps.compute-impacted-targets-test.outputs.impacted_targets_out }}
BAZEL_PATH: ${{ inputs.bazel-path }}
BAZEL_TEST_COMMAND: ${{ inputs.bazel-test-command }}
BAZEL_STARTUP_OPTIONS: ${{ inputs.bazel-startup-options }}
BAZEL_KIND_FILTER: ${{ inputs.test-kind-filter }}
BAZEL_SCOPE_FILTER: ${{ inputs.test-scope-filter }}
BAZEL_NEGATIVE_KIND_FILTER: ${{ inputs.test-negative-kind-filter }}
BAZEL_NEGATIVE_SCOPE_FILTER: ${{ inputs.test-negative-scope-filter }}
BAZEL_NEGATIVE_TAG_FILTER: ${{ inputs.test-negative-tag-filter }}
CI: "true"
Loading