diff --git a/README.md b/README.md index 90ace77..b670d9a 100644 --- a/README.md +++ b/README.md @@ -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: "" diff --git a/action.yml b/action.yml index 17cb80b..92681e5 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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)