Holonomy and resurgence for partition functions