Skip to content

Commit

Permalink
feat(action): add instruments and mongo-uri-env-name inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Jan 18, 2024
1 parent 5ef3186 commit 5764895
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ GitHub Actions for running [CodSpeed](https://codspeed.io) in your CI.
# ⚠️ WARNING: if you use `defaults.run.working-directory`, you must still set this parameter.
working-directory: ""

# [OPTIONAL]
# Comma-separated list of instruments to enable. Possible values: mongodb.
instruments: ""

# [OPTIONAL]
# The name of the environment variable that contains the MongoDB URI to patch.
# If not provided, user will have to provide it dynamically through a CodSpeed integration.
# Only used if the `mongodb` instrument is enabled.
mongo_uri_env_name: ""

# [OPTIONAL]
# A custom upload url, only if you are using an on premise CodSpeed instance
upload-url: ""
Expand Down
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ inputs:
default: "2.0.3"
required: true

instruments:
description: |
Comma separated list of instruments to enable. The following instruments are available:
- `mongodb`: MongoDB instrumentation, requires the MongoDB instrument to be enabled for the organization in CodSpeed
required: false
mongo-uri-env-name:
description: |
The name of the environment variable containing the MongoDB URI. Requires the `mongodb` instrument to be activated in `instruments`.
If the instrumentation is enabled and this value is not set, the user will need to dynamically provide the MongoDB URI to the CodSpeed runner.
required: false

runs:
using: "composite"
steps:
Expand All @@ -45,6 +56,12 @@ runs:
if [ -n "${{ inputs.upload-url }}" ]; then
RUNNER_ARGS="$RUNNER_ARGS --upload-url=${{ inputs.upload-url }}"
fi
if [ -n "${{ inputs.instruments }}" ]; then
RUNNER_ARGS="$RUNNER_ARGS --instruments=${{ inputs.instruments }}"
fi
if [ -n "${{ inputs.mongo-uri-env-name }}" ]; then
RUNNER_ARGS="$RUNNER_ARGS --mongo-uri-env-name=${{ inputs.mongo-uri-env-name }}"
fi
# Install the CodSpeedHQ/runner
head_status=$(curl -I -fsSL -w "%{http_code}" -o /dev/null https://github.com/CodSpeedHQ/runner/releases/download/v${{ inputs.runner-version }}/codspeed-runner-installer.sh)
Expand Down

0 comments on commit 5764895

Please sign in to comment.