config.yml 4.93 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]
Julien Chaumond's avatar
Julien Chaumond committed
30
31
32
            - run:
                command: python -m pytest -n 8 --dist=loadfile -s -v ./tests/
                no_output_timeout: 4h
33

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