As stellar compositions evolve over time in the Milky Way, so will the resulting planet populations. In order to place planet formation in the context of Galactic chemical evolution, we made use of a large (N = 5325) stellar sample representing the thin and thick discs, defined chemically, and the halo, and we simulated planet formation by pebble accretion around these stars. We built a chemical model of their protoplanetary discs, taking into account the relevant chemical transitions between vapour and refractory minerals, in order to track the resulting compositions of formed planets. We find that the masses of our synthetic planets increase on average with increasing stellar metallicity [Fe/H] and that giant planets and super-Earths are ...