  The experiment to detect the global epoch of reionization signature (EDGES)
collaboration reported the detection of a line at 78MHz in the sky-averaged
spectrum due to neutral hydrogen (HI) 21-cm hyperfine absorption of cosmic
microwave background photons at $z\sim 17$. This requires that the spin
temperature of HI be coupled to the kinetic temperature of the gas at this $z$
through the scattering of Ly-$\alpha$ photons emitted by massive stars. To
explain the experimental result, star formation needs to be sufficiently
efficient at $z\sim 17$ and this can be used to constrain models in which
small-scale structure formation is suppressed (DMF models), either due to dark
matter free-streaming or non-standard inflationary dynamics. We combine
simulations of structure formation with a simple recipe for star formation to
investigate whether these models emit enough Ly-$\alpha$ photons to reproduce
the experimental signal for reasonable values of the star formation efficiency,
$f_\star$. We find that a thermal warm dark matter (WDM) model with mass
$m_\mathrm{WDM}\sim 4.3\,\mathrm{keV}$ is consistent with the timing of the
signal for $f_\star\lesssim 2\%$. The exponential growth of structure around
$z\sim 17$ in such a model naturally generates a sharp onset of the absorption.
A warmer model with $m_\mathrm{WDM}\sim 3\,\mathrm{keV}$ requires a higher star
formation efficiency, $f_\star\sim 6\%$, which is a factor of few above
predictions of current star formation models and observations of satellites in
the Milky Way. However, uncertainties in the process of star formation at these
$z$ do not allow to derive strong constrains on such models using 21-cm
absorption line. The onset of the 21-cm absorption is generally faster in DMF
compared to cold dark matter (CDM), unless some process significantly
suppresses star formation in halos with masses below $\sim
10^8\,h^{-1}\,\mathrm{M}_\odot$.
