How to test neovim configurations on CI/CD

I’m trying to add some CI/CD to my own dotfiles, and neovim compatibility with my configs and plugins is very important for me, so I want to test that everything woks fine. I wanted to starat neovim on a pipeline, make sure it executes without errors then exit.
How can I start neovim with flags and then exit but not before all process have finished? If I run nvim +PackerSync +qa it will just open, execute the command and exit before the command finishes at all, which is not what I want.
I also want to make it to report an error code if anything goes wrong.