A U.S. judge in San Francisco has certified a class-action lawsuit against Costco Wholesale Corp. that involved allegations of gender discrimination in the store's promotion practices.