  A spin-photon interface is one of the key components of a quantum network.
Physical platforms under investigation span the range of modern experimental
physics, from ultra-cold atoms and ions to a variety of solid-state systems.
Each system has its strengths and weaknesses, typically with a trade-off
between spin properties and photonic properties. Currently, the best
deterministic single-photon sources use a semiconductor quantum dot embedded in
an optical microcavity. However, coherent spin control has not yet been
integrated with a state-of-the-art single-photon source, and the magnetic noise
from host nuclear spins in the semiconductor environment has placed strong
limitations on the spin coherence. Here, we combine high-fidelity all-optical
spin control with a quantum dot in an open microcavity, currently the most
efficient single-photon source platform available. By imprinting a microwave
signal onto a red-detuned optical field, a Raman process, we demonstrate
coherent rotations of a hole spin around an arbitrary axis of the Bloch sphere,
achieving a maximum {\pi}-pulse fidelity of 98.6%. The cavity enhances the
Raman process, enabling ultra-fast Rabi frequencies above 1 GHz. We use our
flexible spin control to perform optical cooling of the nuclear spins in the
host material via the central hole spin, extending the hole-spin coherence time
T2* from 28 ns to 535 ns. Hahn echo preserves the spin coherence on a timescale
of 20 {\mu}s, and dynamical decoupling extends the coherence close to the
relaxation limit. Both the spin T2* and spin rotation time are much larger than
the Purcell-enhanced radiative recombination time, 50 ps, enabling many
spin-photon pairs to be created before the spin loses its coherence.
