NodeBB tests require database setup beforehand.
I recommend just checking out how NodeBB currently does it with GitHub Actions or how it was done earlier with TravisCI
I haven't used GitLab CI much, but I think the services part is pretty similar to GitHub Actions - there are some setup differences (per job variables instead of per service env for example), but I think just adapting the service configuration to GitLab syntax will be better than the bash based install from TravisCI