* TSX ends up 0.1% at 22,290.62

* Index notches a four-week high

* Energy rises 0.5%

* Materials group adds 0.9%

May 7 (Reuters) - Canada's main stock index rose for a fifth straight day on Tuesday, edging closer to a new record high, as investors grew confident that a rally in heavily-weighted resource shares could be sustained.

The Toronto Stock Exchange's S&P/TSX composite index ended up 31.15 points, or 0.1%, at 22,290.62, extending a string of gains since last Wednesday. It was the highest closing level for the index in four weeks, when it posted a record high of 22,361.78.

Combined, the energy and materials sectors account for 32% of the TSX's weighting while financials account for 29%.

"If you have two out of those three categories that are working, you've got a good market," said Philip Petursson, chief investment strategist at IG Wealth Management.

"I would say that is what has been the trend over the past little while and in our view can continue to be the trend through the summer months."

The energy sector added 0.5% and the materials group, which includes metal miners and fertilizer companies, was up 0.9%.

"Economically, we are in a decent environment from the global perspective ... we have steady growth that is supportive of markets higher but it is also supportive of commodity prices at these levels if not higher as well," Petursson said.

The move toward record highs came ahead of the release this week of earnings from some major companies, such as Suncor Energy Inc, Manulife Financial Corp and Shopify Inc.

The declining sectors on Tuesday included real estate , which fell 0.7%, and consumer staples, which ended 0.5% lower. (Reporting by Fergal Smith in Toronto and Purvi Agarwal in Bengaluru; Editing by Ravi Prakash Kumar, Editing by Alistair Bell)