diff --git a/.codspeed-runner-version b/.codspeed-runner-version index fdc6698..cca25a9 100644 --- a/.codspeed-runner-version +++ b/.codspeed-runner-version @@ -1 +1 @@ -4.4.0 +4.4.1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c1ae5a..f340dec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,7 @@ jobs: - name: Check basic action execution uses: ./ with: + allow-empty: true mode: ${{ matrix.mode }} run: echo "Working!" - name: Check action execution with env variables @@ -42,6 +43,7 @@ jobs: env: MY_ENV_VAR: "Hello" with: + allow-empty: true mode: ${{ matrix.mode }} run: | output=$(echo "$MY_ENV_VAR") @@ -52,6 +54,7 @@ jobs: - name: Check action in a custom directory uses: ./ with: + allow-empty: true mode: ${{ matrix.mode }} working-directory: examples # Check that the directory is actually changed @@ -59,6 +62,7 @@ jobs: - name: Check action with multiline command uses: ./ with: + allow-empty: true mode: ${{ matrix.mode }} run: | echo "Working"; @@ -70,8 +74,8 @@ jobs: matrix: version: - "latest" - - "4.4.0" - - "v4.4.0" + - "4.4.1" + - "v4.4.1" runs-on: ubuntu-latest env: @@ -81,6 +85,7 @@ jobs: - name: Check action with version format ${{ matrix.version }} uses: ./ with: + allow-empty: true runner-version: ${{ matrix.version }} mode: simulation run: echo "Testing version format ${{ matrix.version }}!" diff --git a/action.yml b/action.yml index 0d711d6..0cdb9f0 100644 --- a/action.yml +++ b/action.yml @@ -66,6 +66,12 @@ inputs: required: false default: "~/.cache/codspeed-action" + allow-empty: + description: | + Allow the action to complete successfully even if no benchmarks were found or run. Set to 'true' to enable this behavior. + required: false + default: "false" + runs: using: "composite" steps: @@ -172,6 +178,9 @@ runs: if [ "${{ inputs.cache-instruments }}" = "true" ] && [ -n "${{ inputs.instruments-cache-dir }}" ]; then RUNNER_ARGS="$RUNNER_ARGS --setup-cache-dir=${{ inputs.instruments-cache-dir }}" fi + if [ -n "${{ inputs.allow-empty }}" ]; then + RUNNER_ARGS="$RUNNER_ARGS --allow-empty" + fi # Run the benchmarks codspeed run $RUNNER_ARGS -- '${{ inputs.run }}'