As long as we’re being pedantic, synecdoche means referring to part as the whole (nice wheels = car, nice threads = clothes).

Saying the US did something when referring to the government is metonymy, but not synecdoche.

A synecdoche can either be when you use a part to represent the whole, or conversely use the whole to represent a part

I think it’s valid to consider the US government a part of the US. Thus, referring to the US government when saying that the US did something is a synecdoche