  Measurements of $C\!P$ observables in $B^\pm \rightarrow D^{(*)} K^\pm$ and
$B^\pm \rightarrow D^{(*)} \pi^\pm$ decays are presented, where $D^{(*)}$
indicates a neutral $D$ or $D^*$ meson that is an admixture of meson and
anti-meson states. Decays of the $D^*$ meson to the $D\pi^0$ and $D\gamma$
final states are partially reconstructed without inclusion of the neutral pion
or photon. Decays of the $D$ meson are reconstructed in the $K^\pm \pi^\mp$,
$K^+K^-$, and $\pi^+\pi^-$ final states. The analysis uses a sample of charged
$B$ mesons produced in proton-proton collisions and collected with the LHCb
experiment, corresponding to integrated luminosities of 2.0, 1.0, and 5.7
fb$^{-1}$ taken at centre-of-mass energies of 7, 8, and 13 TeV, respectively.
The measurements of partially reconstructed $B^\pm \to D^* K^\pm$ and $B^\pm
\to D^* \pi^\pm$ with $D \to K^\mp \pi^\pm$ decays are the first of their kind,
and a first observation of the $B^\pm \to (D \pi^0)_{D^*} \pi^\pm$ decay is
made with a significance of 6.1 standard deviations. All $C\!P$ observables are
measured with world-best precision, and in combination with other LHCb results
will provide strong constraints on the CKM angle $\gamma$.
