From bf3e41639d66155329562cb5711e4f522fcf569a Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 16 Jun 2017 20:45:00 -0400 Subject: [PATCH 1/7] Move `circle.yml` to `.circleci/config.yml` This file move is required as part of the CircleCI 2.0 migration process. --- conda_smithy/configure_feedstock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conda_smithy/configure_feedstock.py b/conda_smithy/configure_feedstock.py index 46f8e27f7..3ce69495a 100755 --- a/conda_smithy/configure_feedstock.py +++ b/conda_smithy/configure_feedstock.py @@ -201,7 +201,7 @@ def render_circle(jinja_env, forge_config, forge_dir): for each_target_fname in target_fnames: set_exe_file(each_target_fname, True) - target_fname = os.path.join(forge_dir, 'circle.yml') + target_fname = os.path.join(forge_dir, '.circleci', 'config.yml') template = jinja_env.get_template('circle.yml.tmpl') with write_file(target_fname) as fh: fh.write(template.render(**forge_config)) @@ -665,6 +665,7 @@ def main(forge_file_directory): old_files = [ 'disabled_appveyor.yml', os.path.join('ci_support', 'upload_or_check_non_existence.py'), + 'circle.yml', ] for old_file in old_files: remove_file(os.path.join(forge_dir, old_file)) From c2ba579ac8b85f5f9cd622a48661bddd2cff4dc2 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 16 Jun 2017 20:48:20 -0400 Subject: [PATCH 2/7] Specify CircleCI 2.0 version in config.yml --- conda_smithy/templates/circle.yml.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conda_smithy/templates/circle.yml.tmpl b/conda_smithy/templates/circle.yml.tmpl index bd32de35c..7d9a4298c 100644 --- a/conda_smithy/templates/circle.yml.tmpl +++ b/conda_smithy/templates/circle.yml.tmpl @@ -1,3 +1,5 @@ +version: 2 + {%- block env_branches -%} {%- if not matrix -%} general: From 3e73aefe9b4abf96c6065f1ea5f626a2f8eb37c4 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 16 Jun 2017 22:35:32 -0400 Subject: [PATCH 3/7] Rewrite CircleCI config file for CircleCI 2.0 --- conda_smithy/templates/circle.yml.tmpl | 64 ++++++++++++-------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/conda_smithy/templates/circle.yml.tmpl b/conda_smithy/templates/circle.yml.tmpl index 7d9a4298c..e538ab5aa 100644 --- a/conda_smithy/templates/circle.yml.tmpl +++ b/conda_smithy/templates/circle.yml.tmpl @@ -1,41 +1,35 @@ version: 2 +jobs: + build: + working_directory: ~/test + machine: true {%- block env_branches -%} -{%- if not matrix -%} -general: - branches: - ignore: - - /.*/ - -{% endif -%} -{% endblock -%} -{% block env_dependencies -%} -{%- if matrix -%} -checkout: - post: - - ./ci_support/fast_finish_ci_pr_build.sh - - ./ci_support/checkout_merge_commit.sh - -machine: - services: - - docker - -dependencies: - # Note, we used to use the naive caching of docker images, but found that it was quicker - # just to pull each time. #rollondockercaching - override: - - docker pull condaforge/linux-anvil - -{% endif -%} -{% endblock -%} -test: - override: -{%- block env_test %} +{%- if not matrix %} + branches: + ignore: + - /.*/ +{%- endif -%} +{%- endblock -%} +{%- block env_test -%} {%- if matrix %} - # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. - - ./ci_support/run_docker_build.sh + steps: + - checkout + - run: + name: Fast finish outdated PRs and merge PRs + command: | + ./ci_support/fast_finish_ci_pr_build.sh + ./ci_support/checkout_merge_commit.sh + - run: + command: docker pull condaforge/linux-anvil + - run: + # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. + command: ./ci_support/run_docker_build.sh {% else %} - # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. - - exit 0 -{% endif -%} + steps: + - run: + # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. + command: exit 0 +{# #} +{%- endif -%} {%- endblock %} From fb0dd2c2094f36a27f40efe0b8e5e97eb79a3a08 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 16 Jun 2017 23:42:47 -0400 Subject: [PATCH 4/7] Consolidate Jinja branches in CircleCI config file As the filtered branches having been moved closer to the build step in the CircleCI config file, having two Jinja `if`-clauses no longer makes sense. So this groups them together with the CircleCI skip fallback test. Also this is done such that the CircleCI config file should not change due to this difference in the template. --- conda_smithy/templates/circle.yml.tmpl | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/conda_smithy/templates/circle.yml.tmpl b/conda_smithy/templates/circle.yml.tmpl index e538ab5aa..60a8fc6e8 100644 --- a/conda_smithy/templates/circle.yml.tmpl +++ b/conda_smithy/templates/circle.yml.tmpl @@ -4,13 +4,6 @@ jobs: build: working_directory: ~/test machine: true -{%- block env_branches -%} -{%- if not matrix %} - branches: - ignore: - - /.*/ -{%- endif -%} -{%- endblock -%} {%- block env_test -%} {%- if matrix %} steps: @@ -26,6 +19,9 @@ jobs: # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. command: ./ci_support/run_docker_build.sh {% else %} + branches: + ignore: + - /.*/ steps: - run: # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. From 5eae7be31e769e93b875f6f21156b527ecb591ff Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Sat, 17 Jun 2017 01:16:31 -0400 Subject: [PATCH 5/7] Flip conditional order in CircleCI template --- conda_smithy/templates/circle.yml.tmpl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/conda_smithy/templates/circle.yml.tmpl b/conda_smithy/templates/circle.yml.tmpl index 60a8fc6e8..8922f871d 100644 --- a/conda_smithy/templates/circle.yml.tmpl +++ b/conda_smithy/templates/circle.yml.tmpl @@ -5,7 +5,15 @@ jobs: working_directory: ~/test machine: true {%- block env_test -%} -{%- if matrix %} +{%- if not matrix %} + branches: + ignore: + - /.*/ + steps: + - run: + # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. + command: exit 0 +{% else %} steps: - checkout - run: @@ -18,14 +26,6 @@ jobs: - run: # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. command: ./ci_support/run_docker_build.sh -{% else %} - branches: - ignore: - - /.*/ - steps: - - run: - # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. - command: exit 0 {# #} {%- endif -%} {%- endblock %} From 0394bdf62ae98fa62bbc1f8e5b5f4a2e446a45ba Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 16 Jun 2017 23:09:41 -0400 Subject: [PATCH 6/7] Convert everything into a CircleCI 2.0 Workflow --- conda_smithy/templates/circle.yml.tmpl | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/conda_smithy/templates/circle.yml.tmpl b/conda_smithy/templates/circle.yml.tmpl index 8922f871d..be3097a92 100644 --- a/conda_smithy/templates/circle.yml.tmpl +++ b/conda_smithy/templates/circle.yml.tmpl @@ -13,7 +13,7 @@ jobs: - run: # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. command: exit 0 -{% else %} +{%- else %} steps: - checkout - run: @@ -26,6 +26,22 @@ jobs: - run: # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. command: ./ci_support/run_docker_build.sh -{# #} {%- endif -%} {%- endblock %} + +workflows: + version: 2 + build_and_test: + jobs: +{%- block env_deps -%} +{%- if not matrix %} + - build: + filters: + branches: + ignore: + - /.*/ +{%- else %} + - build +{%- endif -%} +{%- endblock %} +{# #} From d41df0a99c5826096c5e68cc9f9ae879fe3f05ee Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Sat, 17 Jun 2017 20:48:57 -0400 Subject: [PATCH 7/7] Move CircleCI `build` into Jinja conditional For CircleCI matrix support, we will need to construct multiple build steps for different matrix parameters. So it makes more sense to include `build` inside the Jinja conditional instead of outside. This will facilitate making a clean `for`-loop within the last part of the conditional. --- conda_smithy/templates/circle.yml.tmpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/conda_smithy/templates/circle.yml.tmpl b/conda_smithy/templates/circle.yml.tmpl index be3097a92..5c5be5688 100644 --- a/conda_smithy/templates/circle.yml.tmpl +++ b/conda_smithy/templates/circle.yml.tmpl @@ -1,11 +1,11 @@ version: 2 jobs: +{%- block env_test -%} +{%- if not matrix %} build: working_directory: ~/test machine: true -{%- block env_test -%} -{%- if not matrix %} branches: ignore: - /.*/ @@ -14,6 +14,9 @@ jobs: # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. command: exit 0 {%- else %} + build: + working_directory: ~/test + machine: true steps: - checkout - run: