Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
338 views
in Technique[技术] by (71.8m points)

How to speed up Gitlab CI build of a c/c++ project with caching

I am building a C/C++ project in the Gitlab CI. Its compilation result is 360 .lo files and the binary (executable) file. It's a slow process, so I want to speed up it. I thought about caching. How to do it? Before, I used caching for npm, Python modules/packages. But now it's C/C++ object files and they are 360 items. How to do it with CI Yaml file? All these object .lo files are located together with source files in the src/ directory.

question from:https://stackoverflow.com/questions/65886747/how-to-speed-up-gitlab-ci-build-of-a-c-c-project-with-caching

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Caching is the same no matter what objects you're using, so the syntax will be the same for npm and python. In the job that builds your .lo files, add the cache information following the suggestions in the docs (https://docs.gitlab.com/ee/ci/caching/). Then for any other pipelines for that branch (or however you set it up) jobs that depend on the .lo files will download them from the cache instead of creating them.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...