Is there some way to lock step in gitlab ci similar to buildkite for example?
What do you mean by lock? If you want to block next stage if job in previous stage already failed this solution is already build in. If something different (like based on variable) then check
except keywords https://docs.gitlab.com/ee/ci/yaml/#only-and-except-complex.