Write a letter to the company say you are sorry. you should be sorry though. And next time if you and your friend decide to do the same thing again, please make sure that you have your id with you in case of getting caught, because being recorded by company staff is way better than being done by the police.
Warning is not that serious for immigration, but your (future) boss may already has the easier excuse to fire you whenever he/ she wants to do that.