Noah did this; he did all that God commanded him.
Noah did the one thing we should do on a daily basis, trust God. He certainly saw the moral decay around him, but his faith was in God. He had never seen a flood let alone 40 days of solid rain, but he trusted God and fulfilled his task of building the ark. There’s another catastrophe headed toward humanity, if people refuse to enter the ark of salvation offered by Jesus Christ, they will face the same result.