Skip to content

Commit 970ca51

Browse files
committed
ci(ccpp): add --auto-clean flag to lower disk space usage
1 parent 1c9c9f6 commit 970ca51

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/ccpp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install prerequisites
3333
run: scripts/install-prerequisites.sh
3434
- name: Building ${{ matrix.build_option }}
35-
run: python tests/main.py --build-option=${{ matrix.build_option }} build
35+
run: python tests/main.py --build-option=${{ matrix.build_option }} build --auto-clean
3636

3737
build-windows-GCC:
3838
runs-on: windows-2022
@@ -104,7 +104,7 @@ jobs:
104104
if: matrix.build_config == '32bit build'
105105
run: echo "NON_AMD64_BUILD=1" >> $GITHUB_ENV
106106
- name: Run tests
107-
run: python tests/main.py --report --update-image test
107+
run: python tests/main.py --report --update-image test --auto-clean
108108
- name: Archive screenshot errors
109109
if: failure()
110110
uses: actions/upload-artifact@v4

tests/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ def generate_test_images():
236236
help='select test suite to run')
237237
parser.add_argument('--update-image', action='store_true', default=False,
238238
help='Update test image using LVGLImage.py script')
239+
parser.add_argument('--auto-clean', action='store_true', default=False,
240+
help='Automatically clean build directories')
239241

240242
args = parser.parse_args()
241243

@@ -262,6 +264,10 @@ def generate_test_images():
262264
run_tests(options_name, args.test_suite)
263265
except subprocess.CalledProcessError as e:
264266
sys.exit(e.returncode)
267+
if args.auto_clean:
268+
build_dir = get_build_dir(options_name)
269+
print("Removing " + build_dir)
270+
shutil. rmtree(build_dir)
265271

266272
if args.report:
267273
generate_code_coverage_report()

0 commit comments

Comments
 (0)