Help! Worried advice

I had sex with my boyfriend on Monday we used a condom he was going deep he pulled out and realized the condom had broke near the top but he didn't cum in me! Should I take pregnancy test? Or emergency contraception or what we both only 17