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