Checking size of artifacts after build

Hi!

Is there a way to check the size of the generated artifacts, and report test failures if any of the files are over a certain threshold?

I have a job generating installation images, and would like to have checks that we do not go above the size of the target media (the build is still valid, as we can use another medium, but I would like to know).