config.yml 4.85 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
            - run: python -m pytest -sv ./tests/test_tokenization_bert_japanese.py
Aymeric Augustin's avatar
Aymeric Augustin committed
61
    run_examples_torch:
62
63
        working_directory: ~/transformers
        docker:
64
            - image: circleci/python:3.6
65
66
67
68
69
70
        environment:
            OMP_NUM_THREADS: 1
        resource_class: xlarge
        parallelism: 1
        steps:
            - checkout
71
72
            - run: sudo pip install .[sklearn,torch,testing]
            - run: sudo pip install -r examples/requirements.txt
73
74
75
76
            - run: python -m pytest -n 8 --dist=loadfile -s ./examples/ | tee output.txt
            - store_artifacts:
                  path: ~/transformers/output.txt
                  destination: test_output.txt
77
78
79
80
81
82
83
    build_doc:
        working_directory: ~/transformers
        docker:
            - image: circleci/python:3.6
        steps:
            - checkout
            - run: sudo pip install .[tf,torch,docs]
84
            - run: cd docs && make html SPHINXOPTS="-W"
85
86
            - store_artifacts:
                path: ./docs/_build
LysandreJik's avatar
LysandreJik committed
87
    deploy_doc:
88
        working_directory: ~/transformers
LysandreJik's avatar
LysandreJik committed
89
        docker:
90
            - image: circleci/python:3.6
LysandreJik's avatar
LysandreJik committed
91
92
        steps:
            - add_ssh_keys:
93
94
                fingerprints:
                    - "5b:7a:95:18:07:8c:aa:76:4c:60:35:88:ad:60:56:71"
LysandreJik's avatar
LysandreJik committed
95
            - checkout
96
            - run: sudo pip install .[tf,torch,docs]
Lysandre's avatar
Lysandre committed
97
            - run: ./.circleci/deploy.sh
Aymeric Augustin's avatar
Aymeric Augustin committed
98
99
100
101
    check_code_quality:
        working_directory: ~/transformers
        docker:
            - image: circleci/python:3.6
Aymeric Augustin's avatar
Aymeric Augustin committed
102
        resource_class: medium
Aymeric Augustin's avatar
Aymeric Augustin committed
103
104
105
        parallelism: 1
        steps:
            - checkout
106
107
            # 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
108
            - run: sudo pip install .[tf,torch,quality]
109
            - run: black --check --line-length 119 --target-version py35 examples templates tests src utils
110
111
            - run: isort --check-only --recursive examples templates tests src utils
            - run: flake8 examples templates tests src utils
112
    check_repository_consistency:
R茅mi Louf's avatar
R茅mi Louf committed
113
114
        working_directory: ~/transformers
        docker:
115
            - image: circleci/python:3.6
R茅mi Louf's avatar
R茅mi Louf committed
116
117
118
119
120
121
        resource_class: small
        parallelism: 1
        steps:
            - checkout
            - run: sudo pip install requests
            - run: python ./utils/link_tester.py
LysandreJik's avatar
LysandreJik committed
122
123
124
125
workflow_filters: &workflow_filters
    filters:
        branches:
            only:
Lysandre's avatar
Lysandre committed
126
                - master
127
workflows:
LysandreJik's avatar
LysandreJik committed
128
129
130
    version: 2
    build_and_test:
        jobs:
Aymeric Augustin's avatar
Aymeric Augustin committed
131
            - check_code_quality
132
            - check_repository_consistency
Aymeric Augustin's avatar
Aymeric Augustin committed
133
134
135
136
137
            - run_examples_torch
            - run_tests_custom_tokenizers
            - run_tests_torch_and_tf
            - run_tests_torch
            - run_tests_tf
138
            - build_doc
Lysandre's avatar
Lysandre committed
139
            - deploy_doc: *workflow_filters