config.yml 4.9 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
6
        docker:
            - image: circleci/python:3.5
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 -v ./tests/ --cov
16
            - run: codecov
17
18
19
20
21
22
23
24
25
26
27
28
    run_all_tests_torch_and_tf:
        working_directory: ~/transformers
        docker:
            - image: circleci/python:3.5
        environment:
            OMP_NUM_THREADS: 1
            RUN_SLOW: yes
            RUN_CUSTOM_TOKENIZERS: yes
        resource_class: xlarge
        parallelism: 1
        steps:
            - checkout
29
            - run: sudo pip install .[mecab,sklearn,tf-cpu,torch,testing]
30
            - run: python -m pytest -n 8 --dist=loadfile -s -v ./tests/
31
32
            - no_output_timeout: 4h

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