The US federal government is set for its first shutdown in almost seven years after a last-minute attempt at a compromise failed.