It depends what you mean by "compulsory" - e.g, like public school is compulsory (can't graduate), or just that everyone gets the chance to do it (required class).
The local public school system here has a deal with the recreation center to do swimming lessons during the school year. But that's going to be a very local thing unless a state mandates it.
Is that true across all states?