"official/nlp/bert_modeling.py" did not exist on "dab0c03ad2219920277c90536a45886a0fe1f332"
config.yml 9.55 KB
Newer Older
1
version: 2.1
2
setup: true
3
orbs:
4
    continuation: circleci/continuation@0.1.0
5

6
7
8
9
parameters:
    nightly:
        type: boolean
        default: false
10

Julien Chaumond's avatar
Julien Chaumond committed
11
jobs:
12
13
14
    # Ensure running with CircleCI/huggingface
    check_circleci_user:
        docker:
15
            - image: cimg/python:3.8.12
16
17
18
19
20
21
22
23
24
        parallelism: 1
        steps:
            - run: echo $CIRCLE_PROJECT_USERNAME
            - run: |
                if [ "$CIRCLE_PROJECT_USERNAME" = "huggingface" ]; then
                    exit 0
                else
                    echo "The CI is running under $CIRCLE_PROJECT_USERNAME personal account. Please follow https://support.circleci.com/hc/en-us/articles/360008097173-Troubleshooting-why-pull-requests-are-not-triggering-jobs-on-my-organization- to fix it."; exit -1
                fi
Sylvain Gugger's avatar
Sylvain Gugger committed
25
26
    # Fetch the tests to run
    fetch_tests:
27
        working_directory: ~/transformers
28
        docker:
29
            - image: cimg/python:3.8.12
30
31
32
        parallelism: 1
        steps:
            - checkout
Yih-Dar's avatar
Yih-Dar committed
33
34
35
            - run: pip install --upgrade --upgrade-strategy eager pip
            - run: pip install -U --upgrade-strategy eager GitPython
            - run: pip install -U --upgrade-strategy eager .
Sylvain Gugger's avatar
Sylvain Gugger committed
36
            - run: mkdir -p test_preparation
37
            - run: python utils/tests_fetcher.py | tee tests_fetched_summary.txt
38
            - store_artifacts:
39
                  path: ~/transformers/tests_fetched_summary.txt
40
            - run: |
Sylvain Gugger's avatar
Sylvain Gugger committed
41
                if [ -f test_list.txt ]; then
42
                    cp test_list.txt test_preparation/test_list.txt
Sylvain Gugger's avatar
Sylvain Gugger committed
43
44
45
                else
                    touch test_preparation/test_list.txt
                fi
46
47
48
49
50
51
            - run: |
                  if [ -f examples_test_list.txt ]; then
                      mv examples_test_list.txt test_preparation/examples_test_list.txt
                  else
                      touch test_preparation/examples_test_list.txt
                  fi
52
53
54
55
56
57
            - run: |
                  if [ -f filtered_test_list_cross_tests.txt ]; then
                      mv filtered_test_list_cross_tests.txt test_preparation/filtered_test_list_cross_tests.txt
                  else
                      touch test_preparation/filtered_test_list_cross_tests.txt
                  fi
58
59
60
61
62
63
            - run: |
                if [ -f doctest_list.txt ]; then
                    cp doctest_list.txt test_preparation/doctest_list.txt
                else
                    touch test_preparation/doctest_list.txt
                fi
Sylvain Gugger's avatar
Sylvain Gugger committed
64
65
66
67
68
69
70
            - run: |
                if [ -f test_repo_utils.txt ]; then
                    mv test_repo_utils.txt test_preparation/test_repo_utils.txt
                else
                    touch test_preparation/test_repo_utils.txt
                fi
            - run: python utils/tests_fetcher.py --filter_tests
71
72
73
74
75
76
            - run: |
                if [ -f test_list.txt ]; then
                    mv test_list.txt test_preparation/filtered_test_list.txt
                else
                    touch test_preparation/filtered_test_list.txt
                fi
77
78
            - store_artifacts:
                  path: test_preparation/test_list.txt
79
80
            - store_artifacts:
                  path: test_preparation/doctest_list.txt
81
82
            - store_artifacts:
                  path: ~/transformers/test_preparation/filtered_test_list.txt
83
            - store_artifacts:
84
85
                  path: test_preparation/examples_test_list.txt
            - run: python .circleci/create_circleci_config.py --fetcher_folder test_preparation
86
            - run: |
87
88
89
90
91
92
93
                  if [ ! -s test_preparation/generated_config.yml ]; then
                      echo "No tests to run, exiting early!"
                      circleci-agent step halt
                  fi
            - run: cp test_preparation/generated_config.yml test_preparation/generated_config.txt
            - store_artifacts:
                  path: test_preparation/generated_config.txt
Yih-Dar's avatar
Yih-Dar committed
94
95
            - store_artifacts:
                  path: test_preparation/filtered_test_list_cross_tests.txt
96
97
            - continuation/continue:
                  configuration_path: test_preparation/generated_config.yml
98

Sylvain Gugger's avatar
Sylvain Gugger committed
99
100
101
102
    # To run all tests for the nightly build
    fetch_all_tests:
        working_directory: ~/transformers
        docker:
103
            - image: cimg/python:3.8.12
Sylvain Gugger's avatar
Sylvain Gugger committed
104
105
        parallelism: 1
        steps:
106
            - checkout
Yih-Dar's avatar
Yih-Dar committed
107
108
109
            - run: pip install --upgrade --upgrade-strategy eager pip
            - run: pip install -U --upgrade-strategy eager GitPython
            - run: pip install -U --upgrade-strategy eager .
Sylvain Gugger's avatar
Sylvain Gugger committed
110
111
            - run: |
                  mkdir test_preparation
Yih-Dar's avatar
Yih-Dar committed
112
                  echo -n "tests" > test_preparation/test_list.txt
113
                  echo -n "all" > test_preparation/examples_test_list.txt
Yih-Dar's avatar
Yih-Dar committed
114
115
116
117
118
                  echo -n "tests/repo_utils" > test_preparation/test_repo_utils.txt
            - run: |
                  echo -n "tests" > test_list.txt
                  python utils/tests_fetcher.py --filter_tests
                  mv test_list.txt test_preparation/filtered_test_list.txt
119
120
            - run: python .circleci/create_circleci_config.py --fetcher_folder test_preparation
            - run: cp test_preparation/generated_config.yml test_preparation/generated_config.txt
121
            - store_artifacts:
122
123
124
                  path: test_preparation/generated_config.txt
            - continuation/continue:
                  configuration_path: test_preparation/generated_config.yml
125

Aymeric Augustin's avatar
Aymeric Augustin committed
126
127
128
    check_code_quality:
        working_directory: ~/transformers
        docker:
129
            - image: cimg/python:3.8.12
Lysandre's avatar
Lysandre committed
130
        resource_class: large
131
132
        environment:
            TRANSFORMERS_IS_CI: yes
133
            PYTEST_TIMEOUT: 120
Aymeric Augustin's avatar
Aymeric Augustin committed
134
135
136
        parallelism: 1
        steps:
            - checkout
137
138
            - restore_cache:
                  keys:
Yih-Dar's avatar
Yih-Dar committed
139
140
                      - v0.7-code_quality-pip-{{ checksum "setup.py" }}
                      - v0.7-code-quality-pip
141
142
            - restore_cache:
                  keys:
Yih-Dar's avatar
Yih-Dar committed
143
                      - v0.7-code_quality-site-packages-{{ checksum "setup.py" }}
Yih-Dar's avatar
Yih-Dar committed
144
145
146
                      - v0.7-code-quality-site-packages
            - run: pip install --upgrade --upgrade-strategy eager pip
            - run: pip install -U --upgrade-strategy eager .[all,quality]
147
            - save_cache:
Yih-Dar's avatar
Yih-Dar committed
148
                  key: v0.7-code_quality-pip-{{ checksum "setup.py" }}
149
150
                  paths:
                      - '~/.cache/pip'
151
            - save_cache:
Yih-Dar's avatar
Yih-Dar committed
152
                  key: v0.7-code_quality-site-packages-{{ checksum "setup.py" }}
153
154
                  paths:
                      - '~/.pyenv/versions/'
155
156
157
158
159
            - run:
                name: Show installed libraries and their versions
                command: pip freeze | tee installed.txt
            - store_artifacts:
                  path: ~/transformers/installed.txt
160
161
            - run: black --check examples tests src utils
            - run: ruff examples tests src utils
Sylvain Gugger's avatar
Sylvain Gugger committed
162
            - run: python utils/custom_init_isort.py --check_only
163
            - run: python utils/sort_auto_mappings.py --check_only
164
            - run: doc-builder style src/transformers docs/source --max_len 119 --check_only --path_to_docs docs/source
Sylvain Gugger's avatar
Sylvain Gugger committed
165
            - run: python utils/check_doc_toc.py
166

167
    check_repository_consistency:
R茅mi Louf's avatar
R茅mi Louf committed
168
169
        working_directory: ~/transformers
        docker:
170
            - image: cimg/python:3.8.12
Sylvain Gugger's avatar
Sylvain Gugger committed
171
172
173
        resource_class: large
        environment:
            TRANSFORMERS_IS_CI: yes
174
            PYTEST_TIMEOUT: 120
R茅mi Louf's avatar
R茅mi Louf committed
175
176
177
        parallelism: 1
        steps:
            - checkout
Sylvain Gugger's avatar
Sylvain Gugger committed
178
179
            - restore_cache:
                  keys:
Yih-Dar's avatar
Yih-Dar committed
180
181
                      - v0.7-repository_consistency-pip-{{ checksum "setup.py" }}
                      - v0.7-repository_consistency-pip
182
183
            - restore_cache:
                  keys:
Yih-Dar's avatar
Yih-Dar committed
184
                      - v0.7-repository_consistency-site-packages-{{ checksum "setup.py" }}
Yih-Dar's avatar
Yih-Dar committed
185
186
187
                      - v0.7-repository_consistency-site-packages
            - run: pip install --upgrade --upgrade-strategy eager pip
            - run: pip install -U --upgrade-strategy eager .[all,quality]
Sylvain Gugger's avatar
Sylvain Gugger committed
188
            - save_cache:
Yih-Dar's avatar
Yih-Dar committed
189
                  key: v0.7-repository_consistency-pip-{{ checksum "setup.py" }}
Sylvain Gugger's avatar
Sylvain Gugger committed
190
191
                  paths:
                      - '~/.cache/pip'
192
            - save_cache:
Yih-Dar's avatar
Yih-Dar committed
193
                  key: v0.7-repository_consistency-site-packages-{{ checksum "setup.py" }}
194
195
                  paths:
                      - '~/.pyenv/versions/'
196
197
198
199
200
            - run:
                name: Show installed libraries and their versions
                command: pip freeze | tee installed.txt
            - store_artifacts:
                  path: ~/transformers/installed.txt
Sylvain Gugger's avatar
Sylvain Gugger committed
201
202
203
204
205
            - run: python utils/check_copies.py
            - run: python utils/check_table.py
            - run: python utils/check_dummies.py
            - run: python utils/check_repo.py
            - run: python utils/check_inits.py
206
            - run: python utils/check_config_docstrings.py
207
            - run: python utils/check_config_attributes.py
208
            - run: python utils/check_doctest_list.py
Sylvain Gugger's avatar
Sylvain Gugger committed
209
            - run: make deps_table_check_updated
210
            - run: python utils/update_metadata.py --check-only
211
            - run: python utils/check_task_guides.py
212

213
workflows:
LysandreJik's avatar
LysandreJik committed
214
    version: 2
215
216
217
    setup_and_quality:
        when:
            not: <<pipeline.parameters.nightly>>
LysandreJik's avatar
LysandreJik committed
218
        jobs:
219
            - check_circleci_user
Aymeric Augustin's avatar
Aymeric Augustin committed
220
            - check_code_quality
221
            - check_repository_consistency
Sylvain Gugger's avatar
Sylvain Gugger committed
222
            - fetch_tests
223

224
    nightly:
225
        when: <<pipeline.parameters.nightly>>
226
        jobs:
227
            - check_circleci_user
228
229
230
            - check_code_quality
            - check_repository_consistency
            - fetch_all_tests