Baltimore Orioles fans haven’t been able to count on much from their starting rotation this season. But since Aug. 10, 2012, there’s been one formula that’s added up consistently:

Miguel Gonzalez plus Camden Yards equals a win.

The calculation was true again Thursday as Gonzalez (7-3) held the Texas Rangers to one run on four hits in six and two-thirds innings and was backed by home runs from Chris Davis and Brian Roberts in a 3-1 win.

The victory was Baltimore’s 12th straight in games started by Gonzalez at home, and gave the Orioles (51-42) their first back-to-back wins since June 29-30. It came despite some pregame back spasms from the right-hander, who said the trainers were “curious” about them, but that he said he felt good enough to pitch.

“[Gonzalez] was phenomenal. . . . When we were in the training room before the game I wasn’t sure he was gonna make it out there,” Roberts said. “To go six and two-thirds and pitch that way against that kind of team, that’s pretty good work.”

The Post Sports Live crew discusses Bryce Harper’s “play me or trade me” text to Davey Johnson and whether the outfielder has too much control over when he plays. (Post Sports Live)

Davis wasn’t at full strength either. He had been sick — and hitless — through the first games of the series. But he told Manager Buck Showalter he didn’t want a day off, and promptly validated that decision.

“Crush” unloaded on a second-inning offering from Rangers’ starter Ross Wolf (1-2), slinging it over the wall in right-center for his 34th homer and 86th RBI. Roberts smacked a solo shot an inning later to make it 2-0.

“[Gonzalez] was carrying a little more fastball tonight, a little late life,” Showalter said.

In a year that’s seen the offense carry the load more often than not for the O’s, two runs have rarely been enough to propel them to victory. So when Nate McLouth singled home Matt Wieters in the eighth to add an insurance run, the crowd of 21,857 exhaled in the form of its loudest ovation of the night.

Jim Johnson worked a scoreless ninth, his 31st save.

More on the Orioles and MLB

Orioles 3, Rangers 1

The Post Sports Live crew debates whether Bryce Harper will have a more exciting appearance in the MLB All-Star Game or in the Home Run Derby. (Post Sports Live)

Boswell: Camden Yards is finally fun again

Nationals lose third of four to Phillies