Gyro will not show direction as it outputs angular velocity detected around axis. You can use it, but it will difficult and not very precise.
Accelerometer is useful only when robot is moving, otherwise it will output 1G along vertical axis. If Your robot does not use omniwheels, accelerometer can be used to determine if robot is going backward or forward and angle of the turn when it's turning (not applicable for differential drive bots). If robot uses omniwheels and does not rotate around any axis, 2 axis accelerometer will indicate movement in 2D plane and You will be able to know which direction it is heading to.
To know absolute direction of movement of a robot which has front and back (like a car) and does not go sideways - compass is the way to go.