Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/actions/cleanup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "cleanup"
description: "Remove large pre-installed tools to free disk space"

inputs:
show-before:
description: "Print disk usage before cleanup"
required: false
default: "false"
show-after:
description: "Print disk usage after cleanup"
required: false
default: "true"

runs:
using: "composite"
steps:
- name: Show disk usage before cleanup
if: ${{ inputs.show-before == 'true' }}
shell: bash
run: |
echo "=== Disk usage before cleanup ==="
df -h
sudo du -sh /home/* /usr/* /var/* /opt/* 2>/dev/null | sort -h | tail -n 40

- name: Clean up pre-installed tools
shell: bash
run: |
set -e
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/hostedtoolcache
df -h

- name: Show disk usage after cleanup (detailed)
if: ${{ inputs.show-after == 'true' }}
shell: bash
run: |
echo "=== Largest dirs under /usr, /opt, /home ==="
sudo du -sh /usr/* /opt/* /home/* 2>/dev/null | sort -h | tail -n 30
24 changes: 23 additions & 1 deletion .github/workflows/Tendis-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: Unit Test
Expand All @@ -123,6 +125,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: Redis Test
Expand All @@ -148,6 +152,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: Restore Test
Expand All @@ -163,6 +169,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: Repl Test
Expand All @@ -178,6 +186,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: Cluster Test
Expand All @@ -193,6 +203,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: Cluster Test
Expand All @@ -204,10 +216,12 @@ jobs:
runs-on: ubuntu-latest
env:
TEST_DIR: build/bin
steps:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: GoTest
Expand All @@ -225,13 +239,17 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: GoTest
run: |
cd src/tendisplus/integrate_test
chmod +x gotest.sh
./gotest.sh normaltest-part2
rm -rf tmp/ .cache/

test-gotest-normaltest-part3:
needs: [cpplint-check]
name: Test-gotest-normaltest-part3
Expand All @@ -242,6 +260,8 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: GoTest
Expand All @@ -262,6 +282,8 @@ jobs:
fetch-depth: 2
- name: Checkout code
uses: actions/checkout@v3
- name: cleanup
uses: ./.github/actions/cleanup/
- name: compile
uses: ./.github/actions/compile/
- name: GoTest
Expand Down