From c70fac0bc57e3c44cf7308182de64c525f13f413 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Tue, 14 Mar 2023 10:58:49 +0000 Subject: [PATCH] ci: make clean-test-output a script for reuse --- .github/workflows/main.yml | 15 +++------------ ci/clean-test-output.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) create mode 100755 ci/clean-test-output.sh 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