If you're well set up and secure and well insulated, they'd be fine most of the time. Do you have a bath? In a pinch you can set them up overnight/ for a day or two in the bath or bathroom. Depends on the room obviously.
Keep in mind that if you don't have them inside or well observed, you could end up with overheated pigs very quickly in extreme weather. We had hot weather, for us this week(30+), and the pigs burrowed under the fleece together and started cooking. They were limp, floppy and listless, and this was inside as it had heated up after a cool cloudy morning. They would have been better off outside, but our usual max temps are 35ish, not 40 like yours are likely to be.
Depends on your situation really - in Windsor we regularly had 35-40C during the day and my two stayed outside most of the day, came in at night. Ground (grass) temp was 23C, a foot or so up it was 28C. Inside the house was 28C. Very thick buffalo grass, afternoon shade, daytime shade from a tree, lots of plants, lots of shade options, and secure.
Now I have crunchy kikuyu paddocks, no trees, very good breeze though. With a lot of work I can set up a cool safe space for summer, with decent grass too, but they'll still come inside.
If you can't give them a safe protected space you should seriously rethink getting them. If you can, make it as big and secure as you can - at our last house mine had a cage 4x3 grid size(on grass, no wire bottom) for when I wasn't out there and a bigger run under a tree when I was, I just opened the door and spread some boxes and hay out. At night they have a corflute box that sat on the floor in the laundry (summer) or the kitchen (winter). We had the grids, but they don't want to get out so we don't bother with them anymore.
They're migrating around the (new) house now while we try to find a place that works. Yesterday was the bathroom, to cool them down faster.