Skip to content

Commit a69f96f

Browse files
refactor: streamline disk space management in CI workflow (#76)
1 parent 8f0e19c commit a69f96f

1 file changed

Lines changed: 4 additions & 23 deletions

File tree

.github/workflows/reusable_integration-build.yml

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,9 @@ jobs:
8484
name: Integration Test
8585
runs-on: ${{ inputs.repo_runner_labels != '' && (startsWith(inputs.repo_runner_labels, '[') && fromJSON(inputs.repo_runner_labels) || inputs.repo_runner_labels) || 'ubuntu-latest' }}
8686
steps:
87-
- name: Show disk space before build
88-
run: |
89-
echo 'Disk space before build:'
90-
df -h
91-
- name: Removing unneeded software
92-
run: |
93-
echo "Removing unneeded software... "
94-
if [ -d /usr/share/dotnet ]; then echo "Removing dotnet..."; start=$(date +%s); sudo rm -rf /usr/share/dotnet; end=$(date +%s); echo "Duration: $((end-start))s"; fi
95-
#if [ -d /usr/local/lib/android ]; then echo "Removing android..."; start=$(date +%s); sudo rm -rf /usr/local/lib/android; end=$(date +%s); echo "Duration: $((end-start))s"; fi
96-
if [ -d /opt/ghc ]; then echo "Removing haskell (ghc)..."; start=$(date +%s); sudo rm -rf /opt/ghc; end=$(date +%s); echo "Duration: $((end-start))s"; fi
97-
if [ -d /usr/local/.ghcup ]; then echo "Removing haskell (ghcup)..."; start=$(date +%s); sudo rm -rf /usr/local/.ghcup; end=$(date +%s); echo "Duration: $((end-start))s"; fi
98-
if [ -d /usr/share/swift ]; then echo "Removing swift..."; start=$(date +%s); sudo rm -rf /usr/share/swift; end=$(date +%s); echo "Duration: $((end-start))s"; fi
99-
if [ -d /usr/local/share/chromium ]; then echo "Removing chromium..."; start=$(date +%s); sudo rm -rf /usr/local/share/chromium; end=$(date +%s); echo "Duration: $((end-start))s"; fi
100-
- name: Show disk space after cleanup
101-
run: |
102-
echo 'Disk space after cleanup:'
103-
df -h
87+
- name: Clean disk space
88+
uses: eclipse-score/more-disk-space@v1
89+
10490
- name: Checkout repository
10591
uses: actions/checkout@v4.2.2
10692
with:
@@ -113,7 +99,7 @@ jobs:
11399
# Avoid downloading Bazel every time.
114100
bazelisk-cache: true
115101
# Store build cache per workflow.
116-
disk-cache: ${{ github.workflow }}
102+
disk-cache: ${{ inputs.config }}
117103
# Share repository cache between workflows.
118104
repository-cache: true
119105
- name: Update known good commits
@@ -137,11 +123,6 @@ jobs:
137123
python3 scripts/integration_test.py --known-good known_good.updated.json --config "${{ inputs.config }}"
138124
env:
139125
GITHUB_TOKEN: ${{ secrets.REPO_READ_TOKEN != '' && secrets.REPO_READ_TOKEN || github.token }}
140-
- name: Show disk space after build
141-
if: always()
142-
run: |
143-
echo 'Disk space after build:'
144-
df -h
145126
- name: Upload logs artifact
146127
if: always()
147128
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)