President Donald Trump has signed into law legislation funding the government through to the end of September.