diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index dfc8995de..496d9ab04 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -32,7 +32,7 @@ jobs: - name: Install prerequisites run: scripts/install-prerequisites.sh - name: Building ${{ matrix.build_option }} - run: python tests/main.py --build-option=${{ matrix.build_option }} build + run: python tests/main.py --build-option=${{ matrix.build_option }} build --auto-clean build-windows-GCC: runs-on: windows-2022 @@ -104,7 +104,7 @@ jobs: if: matrix.build_config == '32bit build' run: echo "NON_AMD64_BUILD=1" >> $GITHUB_ENV - name: Run tests - run: python tests/main.py --report --update-image test + run: python tests/main.py --report --update-image test --auto-clean - name: Archive screenshot errors if: failure() uses: actions/upload-artifact@v4 diff --git a/tests/main.py b/tests/main.py index 1f400b349..6b60c0fe8 100755 --- a/tests/main.py +++ b/tests/main.py @@ -236,6 +236,8 @@ if __name__ == "__main__": help='select test suite to run') parser.add_argument('--update-image', action='store_true', default=False, help='Update test image using LVGLImage.py script') + parser.add_argument('--auto-clean', action='store_true', default=False, + help='Automatically clean build directories') args = parser.parse_args() @@ -262,6 +264,10 @@ if __name__ == "__main__": run_tests(options_name, args.test_suite) except subprocess.CalledProcessError as e: sys.exit(e.returncode) + if args.auto_clean: + build_dir = get_build_dir(options_name) + print("Removing " + build_dir) + shutil. rmtree(build_dir) if args.report: generate_code_coverage_report()