Global dynamics of Yang–Mills field and perfect-fluid Robertson–Walker cosmologies