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