1919 runs-on : ubuntu-latest
2020
2121 steps :
22+ - name : Free Disk Space
23+ run : |
24+ sudo rm -rf /usr/share/dotnet
25+ sudo rm -rf /opt/ghc
26+ sudo rm -rf /usr/local/share/boost
27+ sudo rm -rf "$AGENT_TOOLSDIRECTORY"
28+ df -h
29+
2230 - uses : actions/checkout@v4
2331
2432 - name : Set up Go
4553 # Build your program with the given configuration
4654 run : cmake --build build --config ${{ env.BUILD_TYPE }}
4755
48- - name : Cleanup
56+ - name : Cleanup Build Trees
4957 run : |
5058 rm -rf ./buildtrees
59+ rm -rf ./deps
60+ df -h
5161
5262 - uses : actions/upload-artifact@v4
5363 with :
6474 working-directory : ${{ github.workspace }}
6575 run : ./pikatests.sh all clean
6676
77+ - name : Cleanup Build Artifacts
78+ run : |
79+ find ./build -name "*.o" -type f -delete
80+ find ./build -name "*.a" -type f -delete
81+ rm -rf ./build/CMakeFiles
82+ rm -rf ./build/_deps
83+ df -h
84+
6785 # master on port 9221, slave on port 9231, all with 2 db
6886 - name : Start codis, pika master and pika slave
6987 working-directory : ${{ github.workspace }}/build
@@ -83,13 +101,35 @@ jobs:
83101 chmod +x integrate_test.sh
84102 sh integrate_test.sh
85103
104+ - name : Cleanup Test Data
105+ if : always()
106+ working-directory : ${{ github.workspace }}/build
107+ run : |
108+ pkill -9 pika || true
109+ pkill -9 codis || true
110+ rm -rf master_data slave_data rename_data acl1_data acl2_data acl3_data
111+ rm -rf codis_data_1 codis_data_2
112+ rm -rf *.conf *.conf.bak
113+ df -h
114+
86115
87116 build_on_centos :
88117 runs-on : ubuntu-latest
89118 container :
90119 image : cheniujh/pika-centos7-ci:v5
91120
92121 steps :
122+ - name : Free Disk Space
123+ run : |
124+ rm -rf /usr/share/dotnet
125+ rm -rf /opt/ghc
126+ rm -rf /usr/local/share/boost
127+ find / -type f -name "*.log" -delete 2>/dev/null || true
128+ find / -type f -name "*.tmp" -delete 2>/dev/null || true
129+ find / -name '*cache*' -type d -exec rm -rf {} + 2>/dev/null || true
130+ find / -name '*.bak' -type f -delete 2>/dev/null || true
131+ df -h
132+
93133 - name : Checkout
94134 uses : actions/checkout@v1
95135 with :
@@ -105,9 +145,14 @@ jobs:
105145 source /opt/rh/devtoolset-10/enable
106146 cmake --build build --config ${{ env.BUILD_TYPE }}
107147
108- - name : Cleanup
148+ - name : Cleanup Build Trees
109149 run : |
110150 rm -rf ./buildtrees
151+ rm -rf ./deps
152+ # Clean build intermediate files but keep binaries
153+ find ./build -name "*.o" -type f -delete || true
154+ find ./build -name "*.a" -type f -delete || true
155+ df -h
111156
112157 - name : Test
113158 working-directory : ${{ github.workspace }}/build
@@ -117,13 +162,48 @@ jobs:
117162 working-directory : ${{ github.workspace }}
118163 run : ./pikatests.sh all clean
119164
165+ - name : Cleanup After Unit Test
166+ run : |
167+ # Clean up test data to free space before integration tests
168+ rm -rf ./log* ./db* ./dump* ./dbsync* || true
169+ df -h
170+
171+ - name : Extreme Disk Cleanup
172+ run : |
173+
174+ rm -rf /usr/local/share/* || true
175+ rm -rf /usr/share/doc/* || true
176+ rm -rf /usr/share/man/* || true
177+ rm -rf /var/cache/* || true
178+
179+ find ${{ github.workspace }} -name "*.o" -type f -delete || true
180+ find ${{ github.workspace }} -name "*.a" -type f -delete || true
181+ find ${{ github.workspace }} -name "*.la" -type f -delete || true
182+ find ${{ github.workspace }} -name "*.so" -type f -delete || true
183+ find ${{ github.workspace }} -name "*.pyc" -type f -delete || true
184+
185+ rm -rf ${{ github.workspace }}/.git || true
186+
187+ df -h
188+
189+ echo "Largest directories:"
190+ du -h --max-depth=2 / 2>/dev/null | sort -hr | head -20
191+
192+ - name : Create Log Directories
193+ run : |
194+ mkdir -p /__w/pikiwidb/pikiwidb/codis/admin/../log
195+ mkdir -p /__w/pikiwidb/pikiwidb/log
196+ mkdir -p ./bin || true
197+ df -h
198+
120199 - name : Start codis, pika master and pika slave
121200 working-directory : ${{ github.workspace }}/build
122201 run : |
123202 chmod +x ../tests/integration/start_master_and_slave.sh
124203 ../tests/integration/start_master_and_slave.sh
125204 chmod +x ../tests/integration/start_codis.sh
126205 ../tests/integration/start_codis.sh
206+
127207 - name : Run Go E2E Tests
128208 working-directory : ${{ github.workspace }}/build
129209 run : |
@@ -133,6 +213,15 @@ jobs:
133213 chmod +x integrate_test.sh
134214 sh integrate_test.sh
135215
216+ - name : Cleanup Test Data
217+ if : always()
218+ working-directory : ${{ github.workspace }}/build
219+ run : |
220+ rm -rf master_data slave_data rename_data acl1_data acl2_data acl3_data
221+ rm -rf codis_data_1 codis_data_2
222+ rm -rf *.conf *.conf.bak
223+ df -h
224+
136225
137226 build_on_macos :
138227
0 commit comments