I'm studying the Yang-Mills theory, with the Action: $$ S=-\frac{1}{2}\int\mathrm{tr}_{\rho}(\mathcal{F}\wedge\star\mathcal{F}) $$ where $\mathcal{F}:=\mathrm{d} \mathcal{A}+\frac{1}{2}[\mathcal{A},\mathcal{A}]$ is the field strength ($\mathcal{A}$ is the Gauge Field), and the trace $\mathrm{tr}_\rho$ is taken over some Represenation $\rho$ of the Gauge Group $G$, and $\star$ is the Hodge star operator. (I'm following the notations in Nakahara's Geometry, topology and physics. )
Then my question is, it seems that mathematically speaking the Gauge Group $G$ and the Representation $\rho$ can be both taken to be arbitary (Nakahara's chapter 10), but why in physics (Peskin's QFT book), we are only considering Semisimple and Compact Gauge Group and unitary represenation? I know they have nice classifying properties, but are there some physical principles that can restrict us to only consider them?