Senate reaches deal on spending bill