From 343c094f2156962a24bf19c5fbd771d01c81caf7 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Fri, 20 Dec 2019 20:56:59 +0100 Subject: [PATCH] Run examples separately from tests. This optimizes the total run time of the Circle CI test suite. --- .circleci/config.yml | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 812817efaa..bfa3b943aa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2 jobs: - build_py3_torch_and_tf: + run_tests_py3_torch_and_tf: working_directory: ~/transformers docker: - image: circleci/python:3.5 @@ -17,7 +17,7 @@ jobs: - run: sudo pip install tensorboardX scikit-learn - run: python -m pytest -n 8 --dist=loadfile -s -v ./transformers/tests/ --cov - run: codecov - build_py3_torch: + run_tests_py3_torch: working_directory: ~/transformers docker: - image: circleci/python:3.5 @@ -32,9 +32,8 @@ jobs: - run: sudo pip install pytest codecov pytest-cov pytest-xdist - run: sudo pip install tensorboardX scikit-learn - run: python -m pytest -n 8 --dist=loadfile -s -v ./transformers/tests/ --cov - - run: python -m pytest -n 8 --dist=loadfile -s -v ./examples/ - run: codecov - build_py3_tf: + run_tests_py3_tf: working_directory: ~/transformers docker: - image: circleci/python:3.5 @@ -50,7 +49,7 @@ jobs: - run: sudo pip install tensorboardX scikit-learn - run: python -m pytest -n 8 --dist=loadfile -s -v ./transformers/tests/ --cov - run: codecov - build_py3_custom_tokenizers: + run_tests_py3_custom_tokenizers: working_directory: ~/transformers docker: - image: circleci/python:3.5 @@ -60,6 +59,21 @@ jobs: - run: sudo pip install pytest pytest-xdist - run: sudo pip install mecab-python3 - run: RUN_CUSTOM_TOKENIZERS=1 python -m pytest -sv ./transformers/tests/tokenization_bert_japanese_test.py + run_examples_py3_torch: + working_directory: ~/transformers + docker: + - image: circleci/python:3.5 + environment: + OMP_NUM_THREADS: 1 + resource_class: xlarge + parallelism: 1 + steps: + - checkout + - run: sudo pip install torch + - run: sudo pip install --progress-bar off . + - run: sudo pip install pytest pytest-xdist + - run: sudo pip install tensorboardX scikit-learn + - run: python -m pytest -n 8 --dist=loadfile -s -v ./examples/ deploy_doc: working_directory: ~/transformers docker: @@ -72,7 +86,7 @@ jobs: - run: sudo pip install --progress-bar off -r docs/requirements.txt - run: sudo pip install --progress-bar off -r requirements.txt - run: ./.circleci/deploy.sh - repository_consistency: + check_repository_consistency: working_directory: ~/transformers docker: - image: circleci/python:3.5 @@ -91,9 +105,10 @@ workflows: version: 2 build_and_test: jobs: - - repository_consistency - - build_py3_custom_tokenizers - - build_py3_torch_and_tf - - build_py3_torch - - build_py3_tf + - check_repository_consistency + - run_examples_py3_torch + - run_tests_py3_custom_tokenizers + - run_tests_py3_torch_and_tf + - run_tests_py3_torch + - run_tests_py3_tf - deploy_doc: *workflow_filters