config.yml 4.99 KB
Newer Older
Julien Chaumond's avatar
Julien Chaumond committed
1
2
version: 2
jobs:
Aymeric Augustin's avatar
Aymeric Augustin committed
3
    run_tests_torch_and_tf:
4
        working_directory: ~/transformers
5
        docker:
6
            - image: circleci/python:3.6
7
8
        environment:
            OMP_NUM_THREADS: 1
9
10
11
12
        resource_class: xlarge
        parallelism: 1
        steps:
            - checkout
13
            - run: sudo pip install .[sklearn,tf-cpu,torch,testing]
14
            - run: sudo pip install codecov pytest-cov
15
            - run: python -m pytest -n 8 --dist=loadfile -s ./tests/ --cov  | tee output.txt
16
            - run: codecov
17
18
19
            - store_artifacts:
                  path: ~/transformers/output.txt
                  destination: test_output.txt
Aymeric Augustin's avatar
Aymeric Augustin committed
20
    run_tests_torch:
21
        working_directory: ~/transformers
Julien Chaumond's avatar
Julien Chaumond committed
22
        docker:
23
            - image: circleci/python:3.7
24
25
        environment:
            OMP_NUM_THREADS: 1
26
        resource_class: xlarge
27
        parallelism: 1
Julien Chaumond's avatar
Julien Chaumond committed
28
29
        steps:
            - checkout
30
            - run: sudo pip install .[sklearn,torch,testing]
31
32
33
34
35
            - run: python -m pytest -n 8 --dist=loadfile -s ./tests/ | tee output.txt
            - store_artifacts:
                  path: ~/transformers/output.txt
                  destination: test_output.txt

Aymeric Augustin's avatar
Aymeric Augustin committed
36
    run_tests_tf:
37
        working_directory: ~/transformers
thomwolf's avatar
thomwolf committed
38
        docker:
39
            - image: circleci/python:3.7
40
41
        environment:
            OMP_NUM_THREADS: 1
thomwolf's avatar
thomwolf committed
42
43
44
45
        resource_class: xlarge
        parallelism: 1
        steps:
            - checkout
46
            - run: sudo pip install .[sklearn,tf-cpu,testing]
47
48
49
50
            - run: python -m pytest -n 8 --dist=loadfile -s ./tests/ | tee output.txt
            - store_artifacts:
               path: ~/transformers/output.txt
               destination: test_output.txt
Aymeric Augustin's avatar
Aymeric Augustin committed
51
    run_tests_custom_tokenizers:
52
53
        working_directory: ~/transformers
        docker:
54
            - image: circleci/python:3.6
55
56
        environment:
            RUN_CUSTOM_TOKENIZERS: yes
57
58
        steps:
            - checkout
59
            - run: sudo pip install .[mecab,testing]
60
61
62
63
            - run: python -m pytest -s ./tests/test_tokenization_bert_japanese.py | tee output.txt
            - store_artifacts:
                path: ~/transformers/output.txt
                destination: test_output.txt
Aymeric Augustin's avatar
Aymeric Augustin committed
64
    run_examples_torch:
65
66
        working_directory: ~/transformers
        docker:
67
            - image: circleci/python:3.6
68
69
70
71
72
73
        environment:
            OMP_NUM_THREADS: 1
        resource_class: xlarge
        parallelism: 1
        steps:
            - checkout
74
75
            - run: sudo pip install .[sklearn,torch,testing]
            - run: sudo pip install -r examples/requirements.txt
76
77
78
79
            - run: python -m pytest -n 8 --dist=loadfile -s ./examples/ | tee output.txt
            - store_artifacts:
                  path: ~/transformers/output.txt
                  destination: test_output.txt
80
81
82
83
84
85
86
    build_doc:
        working_directory: ~/transformers
        docker:
            - image: circleci/python:3.6
        steps:
            - checkout
            - run: sudo pip install .[tf,torch,docs]
87
            - run: cd docs && make html SPHINXOPTS="-W"
88
89
            - store_artifacts:
                path: ./docs/_build
LysandreJik's avatar
LysandreJik committed
90
    deploy_doc:
91
        working_directory: ~/transformers
LysandreJik's avatar
LysandreJik committed
92
        docker:
93
            - image: circleci/python:3.6
LysandreJik's avatar
LysandreJik committed
94
95
        steps:
            - add_ssh_keys:
96
97
                fingerprints:
                    - "5b:7a:95:18:07:8c:aa:76:4c:60:35:88:ad:60:56:71"
LysandreJik's avatar
LysandreJik committed
98
            - checkout
99
            - run: sudo pip install .[tf,torch,docs]
Lysandre's avatar
Lysandre committed
100
            - run: ./.circleci/deploy.sh
Aymeric Augustin's avatar
Aymeric Augustin committed
101
102
103
104
    check_code_quality:
        working_directory: ~/transformers
        docker:
            - image: circleci/python:3.6
Aymeric Augustin's avatar
Aymeric Augustin committed
105
        resource_class: medium
Aymeric Augustin's avatar
Aymeric Augustin committed
106
107
108
        parallelism: 1
        steps:
            - checkout
109
110
            # we need a version of isort with https://github.com/timothycrosley/isort/pull/1000
            - run: sudo pip install git+git://github.com/timothycrosley/isort.git@e63ae06ec7d70b06df9e528357650281a3d3ec22#egg=isort
111
            - run: sudo pip install .[tf,torch,quality]
112
            - run: black --check --line-length 119 --target-version py35 examples templates tests src utils
113
114
            - run: isort --check-only --recursive examples templates tests src utils
            - run: flake8 examples templates tests src utils
115
    check_repository_consistency:
R茅mi Louf's avatar
R茅mi Louf committed
116
117
        working_directory: ~/transformers
        docker:
118
            - image: circleci/python:3.6
R茅mi Louf's avatar
R茅mi Louf committed
119
120
121
122
123
124
        resource_class: small
        parallelism: 1
        steps:
            - checkout
            - run: sudo pip install requests
            - run: python ./utils/link_tester.py
LysandreJik's avatar
LysandreJik committed
125
126
127
128
workflow_filters: &workflow_filters
    filters:
        branches:
            only:
Lysandre's avatar
Lysandre committed
129
                - master
130
workflows:
LysandreJik's avatar
LysandreJik committed
131
132
133
    version: 2
    build_and_test:
        jobs:
Aymeric Augustin's avatar
Aymeric Augustin committed
134
            - check_code_quality
135
            - check_repository_consistency
Aymeric Augustin's avatar
Aymeric Augustin committed
136
137
138
139
140
            - run_examples_torch
            - run_tests_custom_tokenizers
            - run_tests_torch_and_tf
            - run_tests_torch
            - run_tests_tf
141
            - build_doc
Lysandre's avatar
Lysandre committed
142
            - deploy_doc: *workflow_filters