Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ inputs:
java-instrumented-build-system:
description: 'If provided, only the specified build systems will be instrumented (allowed values are `gradle` and `maven`). Otherwise every Java process will be instrumented.'
required: false
cache:
description: 'Enable caching (optional). Defaults to true.'
Copy link
Member

Choose a reason for hiding this comment

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

let's add here that caching only works for Go

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm planning to support dotnet as well in the next PR.

required: false
type: boolean
default: true
# deprecated inputs
service-name:
description: 'Deprecated, alias for service'
Expand All @@ -51,12 +56,40 @@ inputs:
runs:
using: 'composite'
steps:
- name: Set GitHub Path
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
- name: Set global envs and github path
run: |
echo "INSTALLATION_SCRIPT_URL=$INSTALLATION_SCRIPT_URL" >> $GITHUB_ENV
echo "INSTALLATION_SCRIPT_CHECKSUM=$INSTALLATION_SCRIPT_CHECKSUM" >> $GITHUB_ENV
echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
shell: bash
env:
INSTALLATION_SCRIPT_URL: https://install.datadoghq.com/scripts/install_test_visibility_v11.sh
INSTALLATION_SCRIPT_CHECKSUM: fc64c45fd4b45b4b01773c58a3a116bef212dc4095508a6e27e19e50e901bd55
GITHUB_ACTION_PATH: ${{ github.action_path }}

- name: Get Go cache directories
if: ${{ inputs.cache == 'true' && (contains(inputs.languages, 'go') || inputs.languages == 'all') }}
id: go-cache-paths
shell: bash
run: |
echo "TAR_OPTIONS=--skip-old-files" >> $GITHUB_ENV
echo "GOMODCACHE_PATH=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
echo "GOCACHE_PATH=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "GOVERSION=$(go env GOVERSION)" >> $GITHUB_OUTPUT
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_OUTPUT

- name: Go cache
uses: actions/cache@v4
if: ${{ inputs.cache == 'true' && (contains(inputs.languages, 'go') || inputs.languages == 'all') }}
id: go-cache
with:
path: |
${{ steps.go-cache-paths.outputs.GOMODCACHE_PATH }}
${{ env.GITHUB_WORKSPACE }}/.datadog
/github/workspace/.datadog
${{ steps.go-cache-paths.outputs.GOPATH }}/bin/orchestrion
key: test-optimization-go-${{ env.INSTALLATION_SCRIPT_CHECKSUM }}-${{ steps.go-cache-paths.outputs.GOVERSION }}-${{ inputs.go-tracer-version }}-${{ hashFiles('**/go.mod') }}-${{ hashFiles('**/go.sum') }}

- name: Download and run configuration script
id: run-configuration-script
run: |
Expand Down Expand Up @@ -113,8 +146,6 @@ runs:
DD_SET_TRACER_VERSION_RUBY: ${{ inputs.ruby-tracer-version }}
DD_SET_TRACER_VERSION_GO: ${{ inputs.go-tracer-version }}
DD_INSTRUMENTATION_BUILD_SYSTEM_JAVA: ${{ inputs.java-instrumented-build-system }}
INSTALLATION_SCRIPT_URL: https://install.datadoghq.com/scripts/install_test_visibility_v11.sh
INSTALLATION_SCRIPT_CHECKSUM: fc64c45fd4b45b4b01773c58a3a116bef212dc4095508a6e27e19e50e901bd55

- name: Propagate optional site input to environment variable
if: "${{ inputs.site != '' }}"
Expand Down Expand Up @@ -161,3 +192,4 @@ runs:
fi
echo "---" >> $GITHUB_STEP_SUMMARY
shell: bash