The Senate reached a last-minute deal on a $1.7 trillion package to keep the government funded through the next fiscal year.