First it is important to understand what uniform continuity means in a topological space $X$. In its full generality, one needs a uniform structure on $X$ to speak of uniform continuity, but let's stick to an easier concept ; a topological abelian group $X$ is an abelian group in which the operation $+$ is continuous as a function $+ : X \times X \to X$ (when $X \times X$ is equipped with the product topology).
Saying that $f : X \to \mathbb R$ is continuous in this context means that for every $\varepsilon > 0$ and for all $x \in X$, there exists $U_x \subseteq X$ open such that $x - y \in U_x$ implies $|f(x) - f(y)| < \varepsilon$.
Saying that $f : X \to \mathbb R$ is uniformly continuous in this context means that for every $\varepsilon > 0$, there exists $U \subseteq X$ open such that $x - y \in U$ implies $|f(x) - f(y)| < \varepsilon$, i.e. the open set $U$ does not depend on $x$ anymore.
If we take an arbitrary abelian group $X$ and equip it with the trivial topology (all its subsets are open), then of course this turns $X$ into a topological abelian group.
Take an arbitrary function $f : X \to \mathbb R$. Taking $U = \{0\}$ (where $0 \in X$ is the neutral element for addition), we see that $f$ is uniformly continuous, hence continuous. If the abelian group is infinite, the open cover that consists of a singleton for each point does not admit a finite subcover. More formally,
$$
X = \bigcup_{x \in X} \{ x \}
$$
is an open cover of $X$ which does not admit a finite subcover because $X$ is not finite. Therefore $X$ satisfies the property that every function $f : X \to \mathbb R$ is continuous, but $X$ is not compact.
Added : Even if $X \subseteq \mathbb R^n$ to put yourself in the context where compact is equivalent to closed and bounded, your guess is still wrong. Take $n = 1$ and see that as a subset of $\mathbb R$, $\mathbb Z$ is still endowed with the discrete topology, so that the proof above applies.
Hope that helps,