diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93a55a6a6..012186e0b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -103,10 +103,7 @@ jobs: - run: cargo test - name: Clear intermediate test output - run: | - df -h - rm -rf target/tmp - df -h + run: ci/clean-test-output.sh - name: gitoxide tests (all git-related tests) run: cargo test git env: @@ -114,10 +111,7 @@ jobs: # The testsuite generates a huge amount of data, and fetch-smoke-test was # running out of disk space. - name: Clear test output - run: | - df -h - rm -rf target/tmp - df -h + run: ci/clean-test-output.sh - name: Check operability of rustc invocation with argfile env: __CARGO_TEST_FORCE_ARGFILE: 1 @@ -151,10 +145,7 @@ jobs: # The testsuite generates a huge amount of data, and fetch-smoke-test was # running out of disk space. - name: Clear benchmark output - run: | - df -h - rm -rf target/tmp - df -h + run: ci/clean-test-output.sh - name: Fetch smoke test run: ci/fetch-smoke-test.sh diff --git a/ci/clean-test-output.sh b/ci/clean-test-output.sh new file mode 100755 index 000000000..f1f2ec61c --- /dev/null +++ b/ci/clean-test-output.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# This script remove test and benchmark output and displays disk usage. + +set -euo pipefail + +df -h +rm -rf target/tmp +df -h