Im trying out Gitlab CI with yaml files.
What im trying to do is a simple build -> test -> analyze
Looking at all the examples it seems that these should be defined as “jobs”.
I did that method and get everything working
build_local: type: build tags: - linux script: "cd build && cmake .. && make -j12" test_local: type: test tags: - linux script: "cd build && cmake .. && make -j12 && ctest -j12" analyze_local: type: analyze tags: - linux - sonar only: - master script: "cd build && cmake .. && make -j12 && ctest -j12 && make sonar"
however doing this means that every step has to build and run tests.
I was thinking of just disabling all the jobs except for “analyze_local” as it does the other two steps as well.
Is there a more elegant way of doing this? or is there anyway to share the build artifacts to the next phase for the same job?
ex. Build -> spit out a binary, then pass those to the “test” job so i dont have to rebuild the same files again.