Skip to content

Commit

Permalink
feat: simplify action output
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencaccia committed Dec 1, 2023
1 parent 0c6eabe commit 6790ba2
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,23 @@ inputs:
runs:
using: "composite"
steps:
# Build the args string
- id: args
shell: bash
- shell: bash
run: |
args=""
# Configure and run codspeed-runner
# Get the runner arguments
RUNNER_ARGS=""
if [ -n "${{ inputs.token }}" ]; then
args="$args --token ${{ inputs.token }}"
RUNNER_ARGS="$RUNNER_ARGS --token ${{ inputs.token }}"
fi
if [ -n "${{ inputs.working-directory }}" ]; then
args="$args --working-directory=${{ inputs.working-directory }}"
RUNNER_ARGS="$RUNNER_ARGS --working-directory=${{ inputs.working-directory }}"
fi
if [ -n "${{ inputs.upload-url }}" ]; then
args="$args --upload-url=${{ inputs.upload-url }}"
RUNNER_ARGS="$RUNNER_ARGS --upload-url=${{ inputs.upload-url }}"
fi
echo "args=$args" >> $GITHUB_OUTPUT
# Install the CodSpeedHQ/runner
- shell: bash
run: |
# 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)
if [ "$head_status" -eq 404 ]; then
echo "Error: Version ${{ inputs.runner-version }} is not available in https://github.com/CodSpeedHQ/runner/releases, please a correct version."
Expand All @@ -57,6 +55,5 @@ runs:
curl -fsSL https://github.com/CodSpeedHQ/runner/releases/download/v${{ inputs.runner-version }}/codspeed-runner-installer.sh | bash -s -- --quiet
fi
# Run the benchmarks
- shell: bash
run: codspeed-runner ${{ steps.args.outputs.args }} -- '${{ inputs.run }}'
# Run the benchmarks
codspeed-runner $RUNNER_ARGS -- '${{ inputs.run }}'

0 comments on commit 6790ba2

Please sign in to comment.