Run the good race

To do the best that one can.

The politician ran the good race but in the end he lost the election.