It is certainly possible. There’s a bit of wiring you’d need to do, but here is how I would do it.
Firstly, stating the obvious, you need a test runner capable of producing a percentage coverage value. Sounds like you have got that already. Then you need a way of storing this. One easy way to do this is to create a new Git repo specifically for coverage, and in your build commit a new value each time. You can then use Git commands to fetch the previous value. This would use the same repo SSH keys as your project.
Alternatively, you could use the CircleCI cache. The cache key could be the branch name, so branches are allowed to reduce coverage for the first commit, or if you want to be strict, have a fixed cache key so that any branch must increase coverage.
The Git approach is perhaps a bit “untidy” at first glance, but it has the advantage that it is easier to debug - you can use your code host to explore your coverage history.
Either way, you might want to implement a tagging system that allows you to escape this check. If you have an emergency hotfix to write, the last thing you want to deal with is a build system that won’t let you deploy your fix. Maybe a tag of
no-coverage-check or something like that.