John Swinney has hailed the “phenomenal contribution” made by two senior members of his Cabinet as they announced plans to step down at next year’s Holyrood election.