@Alex A ...by being very careful and cautious on what he says/ does. It can be done. It's the same way many devout Catholics survive the scrutiny of their anti-Catholic, anti-Christian co-workers and superiors every day of their professional careers.
When I was in the seminary (80s) at least half were flamers. Some were ordained some not. Many who didn’t have partners and are quite anti-Catholic and pro-abortion. It is so sad. Blessed to have learned that my true vocation was to be a husband and father.