config.yml 4.13 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

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