Depends on the gradient and length.

The steeper the hill, the more likely I'd prefer to run up it.

However, anything longer than 2 km I prefer spinning my way up in a low gear.