github-action-benchmark icon indicating copy to clipboard operation
github-action-benchmark copied to clipboard

github action continue after error in `foo | tee output.txt`

Open LuckyTurtleDev opened this issue 1 year ago • 1 comments

if you use run cargo +nightly bench | tee output.txt exit code 0 will be returned if cargo exit with an error, because tee has exit successful. So github action continue after the error and does not fail.

LuckyTurtleDev avatar Aug 13 '23 18:08 LuckyTurtleDev

The readme/example should suggest

- name: Run benchmark
        run: |
          set -eo pipefail
          cargo +nightly bench | tee output.txt

instead of

- name: Run benchmark
        run:  cargo +nightly bench | tee output.txt

Same for the other languages.

LuckyTurtleDev avatar Aug 13 '23 19:08 LuckyTurtleDev