|
1 | 1 | version: 2.1 |
2 | 2 |
|
| 3 | +# Parameters required to trigger the execution |
| 4 | +# of the "doc-min-dependencies" and "doc" jobs |
| 5 | +parameters: |
| 6 | + GITHUB_RUN_URL: |
| 7 | + type: string |
| 8 | + default: "none" |
| 9 | + |
3 | 10 | jobs: |
4 | 11 | doc-min-dependencies: |
5 | 12 | docker: |
6 | 13 | - image: cimg/python:3.8.12 |
7 | 14 | environment: |
8 | | - - OMP_NUM_THREADS: 2 |
9 | | - - MKL_NUM_THREADS: 2 |
10 | | - - CONDA_ENV_NAME: testenv |
11 | | - - PYTHON_VERSION: 3.8 |
12 | | - - NUMPY_VERSION: 'min' |
13 | | - - SCIPY_VERSION: 'min' |
14 | | - - MATPLOTLIB_VERSION: 'min' |
15 | | - - CYTHON_VERSION: 'min' |
16 | | - - SCIKIT_IMAGE_VERSION: 'min' |
17 | | - - SPHINX_VERSION: 'min' |
18 | | - - PANDAS_VERSION: 'min' |
19 | | - - SPHINX_GALLERY_VERSION: 'min' |
20 | | - - NUMPYDOC_VERSION: 'min' |
21 | | - - SPHINX_PROMPT_VERSION: 'min' |
22 | | - - SPHINXEXT_OPENGRAPH_VERSION: 'min' |
| 15 | + - GITHUB_ARTIFACT_URL: << pipeline.parameters.GITHUB_RUN_URL >>/doc-min-dependencies.zip |
23 | 16 | steps: |
24 | 17 | - checkout |
25 | | - - run: ./build_tools/circle/checkout_merge_commit.sh |
26 | | - - restore_cache: |
27 | | - key: v1-doc-min-deps-datasets-{{ .Branch }} |
28 | | - - restore_cache: |
29 | | - keys: |
30 | | - - doc-min-deps-ccache-{{ .Branch }} |
31 | | - - doc-min-deps-ccache |
32 | | - - run: ./build_tools/circle/build_doc.sh |
33 | | - - save_cache: |
34 | | - key: doc-min-deps-ccache-{{ .Branch }}-{{ .BuildNum }} |
35 | | - paths: |
36 | | - - ~/.ccache |
37 | | - - ~/.cache/pip |
38 | | - - save_cache: |
39 | | - key: v1-doc-min-deps-datasets-{{ .Branch }} |
40 | | - paths: |
41 | | - - ~/scikit_learn_data |
| 18 | + - run: bash build_tools/circle/download_documentation.sh |
42 | 19 | - store_artifacts: |
43 | 20 | path: doc/_build/html/stable |
44 | 21 | destination: doc |
45 | | - - store_artifacts: |
46 | | - path: ~/log.txt |
47 | | - destination: log.txt |
48 | 22 |
|
49 | 23 | doc: |
50 | 24 | docker: |
51 | 25 | - image: cimg/python:3.8.12 |
52 | 26 | environment: |
53 | | - - OMP_NUM_THREADS: 2 |
54 | | - - MKL_NUM_THREADS: 2 |
55 | | - - CONDA_ENV_NAME: testenv |
56 | | - - PYTHON_VERSION: '3.9' |
57 | | - - NUMPY_VERSION: 'latest' |
58 | | - - SCIPY_VERSION: 'latest' |
59 | | - - MATPLOTLIB_VERSION: 'latest' |
60 | | - - CYTHON_VERSION: 'latest' |
61 | | - - SCIKIT_IMAGE_VERSION: 'latest' |
62 | | - # Bump the sphinx version from time to time. Avoid latest sphinx version |
63 | | - # that tends to break things slightly too often |
64 | | - - SPHINX_VERSION: 4.2.0 |
65 | | - - PANDAS_VERSION: 'latest' |
66 | | - - SPHINX_GALLERY_VERSION: 'latest' |
67 | | - - NUMPYDOC_VERSION: 'latest' |
68 | | - - SPHINX_PROMPT_VERSION: 'latest' |
69 | | - - SPHINXEXT_OPENGRAPH_VERSION: 'latest' |
| 27 | + - GITHUB_ARTIFACT_URL: << pipeline.parameters.GITHUB_RUN_URL >>/doc.zip |
70 | 28 | steps: |
71 | 29 | - checkout |
72 | | - - run: ./build_tools/circle/checkout_merge_commit.sh |
73 | | - - restore_cache: |
74 | | - key: v1-doc-datasets-{{ .Branch }} |
75 | | - - restore_cache: |
76 | | - keys: |
77 | | - - doc-ccache-{{ .Branch }} |
78 | | - - doc-ccache |
79 | | - - run: ./build_tools/circle/build_doc.sh |
80 | | - - save_cache: |
81 | | - key: doc-ccache-{{ .Branch }}-{{ .BuildNum }} |
82 | | - paths: |
83 | | - - ~/.ccache |
84 | | - - ~/.cache/pip |
85 | | - - save_cache: |
86 | | - key: v1-doc-datasets-{{ .Branch }} |
87 | | - paths: |
88 | | - - ~/scikit_learn_data |
| 30 | + - run: bash build_tools/circle/download_documentation.sh |
89 | 31 | - store_artifacts: |
90 | 32 | path: doc/_build/html/stable |
91 | 33 | destination: doc |
92 | | - - store_artifacts: |
93 | | - path: ~/log.txt |
94 | | - destination: log.txt |
95 | | - # Persists generated documentation so that it can be attached and deployed |
96 | | - # in the 'deploy' step. |
| 34 | + # Persists the generated documentation, so that it |
| 35 | + # can be attached and deployed in the "deploy" job |
97 | 36 | - persist_to_workspace: |
98 | 37 | root: doc/_build/html |
99 | 38 | paths: . |
100 | 39 |
|
101 | | - lint: |
102 | | - docker: |
103 | | - - image: cimg/python:3.8.12 |
104 | | - steps: |
105 | | - - checkout |
106 | | - - run: ./build_tools/circle/checkout_merge_commit.sh |
107 | | - - run: |
108 | | - name: dependencies |
109 | | - command: pip install flake8 |
110 | | - - run: |
111 | | - name: linting |
112 | | - command: ./build_tools/circle/linting.sh |
113 | | - |
114 | 40 | linux-arm64: |
115 | 41 | machine: |
116 | 42 | image: ubuntu-2004:202101-01 |
@@ -151,18 +77,23 @@ jobs: |
151 | 77 |
|
152 | 78 | workflows: |
153 | 79 | version: 2 |
| 80 | + |
154 | 81 | build-doc-and-deploy: |
| 82 | + when: |
| 83 | + not: |
| 84 | + equal: [ "none", << pipeline.parameters.GITHUB_RUN_URL >> ] |
| 85 | + # The jobs should run only when triggered by the workflow |
155 | 86 | jobs: |
156 | | - - lint |
157 | | - - doc: |
158 | | - requires: |
159 | | - - lint |
160 | | - - doc-min-dependencies: |
161 | | - requires: |
162 | | - - lint |
| 87 | + - doc-min-dependencies |
| 88 | + - doc |
163 | 89 | - deploy: |
164 | 90 | requires: |
165 | 91 | - doc |
| 92 | + |
166 | 93 | linux-arm64: |
| 94 | + when: |
| 95 | + equal: [ "none", << pipeline.parameters.GITHUB_RUN_URL >> ] |
| 96 | + # Prevent double execution of this job: on push |
| 97 | + # by default and when triggered by the workflow |
167 | 98 | jobs: |
168 | 99 | - linux-arm64 |
0 commit comments