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