A search for CP violation in $D^0 rightarrow K^{-} K^{+} $ and $D^0 rightarrow pi^{-} pi^{+} $ decays is performed using $pp$ collision data, corresponding to an integrated luminosity of $3~fb^{-1}$, collected using the LHCb detector at centre-of-mass energies of 7 and $8~$TeV. The flavour of the charm meson is inferred from the charge of the pion in $D^{*+}rightarrow D^0pi^+$ and $D^{*-}rightarrow bar{D^0}pi^{-}$ decays. The difference between the CP asymmetries in $D^0 rightarrow K^{-} K^{+} $ and $D^0 rightarrow pi^{-} pi^{+} $ decays, $Delta A_{CP} equiv A_{CP}(K^{-} K^{+}) - A_{CP}(pi^{-} pi^{+})$, is measured to be $left( -0.10 pm 0.08(stat) pm 0.03(syst) right) %$. This is the most precise measurement of a time-integrated CP asymmetry in the charm sector from a single experiment.