ci(ccpp): add --auto-clean flag to lower disk space usage
This commit is contained in:
4
.github/workflows/ccpp.yml
vendored
4
.github/workflows/ccpp.yml
vendored
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user