Github Action exit monitor through code / ESP integration testing

Hello,

I would appreciate some direction on this. I am using Github Actions, and after compiling my code, I want to upload it remotly, and

  1. check if its crashes my ESP, exit with 1 or return 1. → I can fail the github action
  2. Go through my setup() and if it doesn’t crash then exit 0. (Basically, check if its okay)

I am trying to get some output in regards to the happenings inside of an ESP/Arduino for a GitHub action so I can validate my code.

I know unit testing is a thing, but I want to write integration tests where everything works as a whole.

Thanks for your time