diff --git a/conda_smithy/templates/circle.yml.tmpl b/conda_smithy/templates/circle.yml.tmpl index ecf57a7c0..4c20b7daf 100644 --- a/conda_smithy/templates/circle.yml.tmpl +++ b/conda_smithy/templates/circle.yml.tmpl @@ -27,11 +27,20 @@ jobs: command: | ./.circleci/fast_finish_ci_pr_build.sh ./.circleci/checkout_merge_commit.sh + - restore_cache: + keys: + - ccache-{{ '{{' }} .Branch {{ '}}' }} + - ccache-master - run: command: docker pull {{ docker.image }} - run: # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. command: ./.circleci/run_docker_build.sh + - save_cache: + key: ccache-{{ '{{' }} .Branch {{ '}}' }} + paths: + - ./build_artifacts/.ccache + when: always {%- endfor -%} {%- endif -%} {%- endblock %} diff --git a/conda_smithy/templates/run_docker_build.tmpl b/conda_smithy/templates/run_docker_build.tmpl index 564c7920e..799cb0461 100644 --- a/conda_smithy/templates/run_docker_build.tmpl +++ b/conda_smithy/templates/run_docker_build.tmpl @@ -60,7 +60,11 @@ conda install --yes --quiet conda-forge-build-setup=1 {% if build_setup -%} {{ build_setup }}{% endif -%} -conda build /home/conda/recipe_root -m /home/conda/feedstock_root/.ci_support/${CONFIG}.yaml --quiet || exit 1 +# ccache uses the compiler command line to generate the cache keys, so we can't have a +# different path for every build. ccache provides CCACHE_BASEDIR variable to solve this +# but it's better to avoid setting it as it has some side effects. +conda build --no-build-id /home/conda/recipe_root -m /home/conda/feedstock_root/.ci_support/${CONFIG}.yaml --quiet || exit 1 + {%- for owner, channel in channels['targets'] %} {{ upload_script }} /home/conda/recipe_root {{ owner }} --channel={{ channel }} -m /home/conda/feedstock_root/.ci_support/${CONFIG}.yaml || exit 1 {%- endfor %} diff --git a/conda_smithy/templates/travis.yml.tmpl b/conda_smithy/templates/travis.yml.tmpl index d5982864e..bfc7a54a4 100644 --- a/conda_smithy/templates/travis.yml.tmpl +++ b/conda_smithy/templates/travis.yml.tmpl @@ -6,6 +6,10 @@ language: generic os: osx osx_image: xcode6.4 +cache: + directories: + - $HOME/.ccache + {% block env -%} {% if configs[0] or travis.secure -%} env: @@ -66,7 +70,10 @@ install: {{ build_setup }}{% endif %} script: - - conda build ./{{ recipe_dir }} -m ./.ci_support/${CONFIG}.yaml + # ccache uses the compiler command line to generate the cache keys, so we can't have a + # different path for every build. ccache provides CCACHE_BASEDIR variable to solve this + # but it's better to avoid setting it as it has some side effects. + - conda build --no-build-id ./{{ recipe_dir }} -m ./.ci_support/${CONFIG}.yaml {% for owner, channel in channels['targets'] %} - {{ upload_script }} ./{{ recipe_dir }} {{ owner }} --channel={{ channel }} -m ./.ci_support/${CONFIG}.yaml {% endfor %}