Do metals always give electrons,share electrons or take electrons?

Beryllium chloride $\left({\text{BeCl}}_{2}\right)$ is a covalent compound even though beryllium is an alkaline earth metal (group 2/IIA). In the diagram below, the lines represent covalent bonds, indicating that beryllium and chlorine share electrons.