Search code examples
appveyor

Appveyor caching of dependencies


I'm using extra-cmake-modules and currently clone it on every build and install it on every build.

https://github.com/Snorenotify/Snorenotify/blob/master/appveyor.yml#L15

It would be great if I could cache the build as I don't need the latest version on every push.

But the documentation regarding caching doesn't offer a similar example. Is my scenario possible at all?

Cheers


Solution

  • You should only clone that repo if the directory does not exist:

    - IF NOT EXIST %APPVEYOR_BUILD_FOLDER%\work\extra-cmake-modules git clone git://anongit.kde.org/extra-cmake-modules.git
    

    Then define cache entry in appveyor.yml:

    cache:
    - work\extra-cmake-modules -> appveyor.yml
    

    which means "cache work\extra-cmake-modules folder unless appveyor.yml is changed".

    Hope that helps.