Skip to content

Commit 4a3c588

Browse files
committed
Auto merge of #11848 - weihanglo:rmrf, r=epage
ci: make clean-test-output a script for reuse
2 parents 9282cf7 + 6712c51 commit 4a3c588

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,15 @@ jobs:
103103

104104
- run: cargo test
105105
- name: Clear intermediate test output
106-
run: |
107-
df -h
108-
rm -rf target/tmp
109-
df -h
106+
run: ci/clean-test-output.sh
110107
- name: gitoxide tests (all git-related tests)
111108
run: cargo test git
112109
env:
113110
__CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2: 1
114111
# The testsuite generates a huge amount of data, and fetch-smoke-test was
115112
# running out of disk space.
116113
- name: Clear test output
117-
run: |
118-
df -h
119-
rm -rf target/tmp
120-
df -h
114+
run: ci/clean-test-output.sh
121115
- name: Check operability of rustc invocation with argfile
122116
env:
123117
__CARGO_TEST_FORCE_ARGFILE: 1
@@ -151,10 +145,7 @@ jobs:
151145
# The testsuite generates a huge amount of data, and fetch-smoke-test was
152146
# running out of disk space.
153147
- name: Clear benchmark output
154-
run: |
155-
df -h
156-
rm -rf target/tmp
157-
df -h
148+
run: ci/clean-test-output.sh
158149
- name: Fetch smoke test
159150
run: ci/fetch-smoke-test.sh
160151

@@ -179,8 +170,6 @@ jobs:
179170

180171
build_std:
181172
runs-on: ubuntu-latest
182-
env:
183-
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
184173
steps:
185174
- uses: actions/checkout@v3
186175
- run: rustup update nightly && rustup default nightly

ci/clean-test-output.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
# This script remove test and benchmark output and displays disk usage.
3+
4+
set -euo pipefail
5+
6+
df -h
7+
rm -rf target/tmp
8+
df -h

0 commit comments

Comments
 (0)