  After the Higgs boson discovery, a main focus at the CERN LHC has been the
measurement of its properties. Observing the Higgs boson associated production
with a top quark-antiquark pair ($\mathrm{t\bar{t}H}$) is particularly
interesting because it provides tree-level access to measuring the Higgs
boson-top quark Yukawa coupling. However, the production of a single top quark
in association with the Higgs boson ($\mathrm{tH}$) is also sensitive to the
sign of this coupling. This coupling is essential for the stability of the
Higgs potential at high energy scales and can also be a probe for physics
beyond the standard model (SM). The latest measurements of the
$\mathrm{t\bar{t}H}$ and $\mathrm{tH}$ associated production rates performed by
the CMS Collaboration with proton-proton collision events at $\sqrt{s} =13$ TeV
in the diphoton and multilepton channels are presented here. Events are
categorized according to the lepton and jet multiplicities, and multivariate
classifiers are used to distinguish signal from background processes. The
results are consistent with the SM predictions and feature the first
observation of $\mathrm{t\bar{t}H}$ production in a single Higgs boson decay
channel along with the first tests of its CP structure.
