ci: make clean-test-output a script for reuse

This commit is contained in:
Weihang Lo 2023-03-14 10:58:49 +00:00
parent 9282cf74a3
commit c70fac0bc5
No known key found for this signature in database
GPG Key ID: D7DBF189825E82E7
2 changed files with 11 additions and 12 deletions

View File

@ -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

8
ci/clean-test-output.sh Executable file
View File

@ -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