Simulating Dirac fermions with Abelian and non-Abelian gauge fields in optical lattices