Update PR status with results of an external test

I have a long-running (async) test that runs against a staging server based of my commit whose results I want to use to as a check (and comment) on the PR. The result of this test run can be fetched via an HTTP call.

Given the response won’t be available immediately how can I use this response to update my PR?

Thanks!