|
1 | | -version: 2 |
| 1 | +version: '2.1' |
| 2 | +orbs: |
| 3 | + browser-tools: circleci/browser-tools@1.4.6 |
2 | 4 |
|
3 | | -jobs: |
4 | | - "percy-finalize": |
| 5 | +executors: |
| 6 | + percy-executor: |
5 | 7 | docker: |
6 | 8 | - image: percyio/agent |
7 | 9 | auth: |
8 | | - username: dashautomation |
9 | | - password: $DASH_PAT_DOCKERHUB |
10 | | - steps: |
11 | | - - run: percy finalize --all |
12 | | - "node": |
| 10 | + username: dashautomation |
| 11 | + password: $DASH_PAT_DOCKERHUB |
| 12 | + node-executor: |
13 | 13 | docker: |
14 | | - - image: circleci/node:8.11.3 |
| 14 | + - image: cimg/node:20.5.1 |
15 | 15 | auth: |
16 | 16 | username: dashautomation |
17 | 17 | password: $DASH_PAT_DOCKERHUB |
18 | | - |
| 18 | + python-3-11-executor: |
| 19 | + docker: |
| 20 | + - image: cimg/python:3.11.5-browsers |
| 21 | + auth: |
| 22 | + username: dashautomation |
| 23 | + password: $DASH_PAT_DOCKERHUB |
| 24 | + python-3-6-executor: |
| 25 | + docker: |
| 26 | + - image: cimg/python:3.6.15-browsers |
| 27 | + auth: |
| 28 | + username: dashautomation |
| 29 | + password: $DASH_PAT_DOCKERHUB |
| 30 | + |
| 31 | +jobs: |
| 32 | + percy-finalize: |
| 33 | + executor: percy-executor |
| 34 | + steps: |
| 35 | + - run: percy finalize --all |
| 36 | + node: |
| 37 | + executor: node-executor |
19 | 38 | steps: |
20 | 39 | - checkout |
21 | | - |
22 | | - - restore_cache: |
23 | | - key: deps1-{{ .Branch }}-{{ checksum "package.json" }} |
24 | | - |
25 | 40 | - run: |
26 | | - name: Install package.json |
27 | | - command: npm i |
| 41 | + name: Install package.json |
| 42 | + command: npm i |
28 | 43 |
|
29 | 44 | - save_cache: |
30 | | - key: deps1-{{ .Branch }}-{{ checksum "package.json" }} |
31 | | - paths: |
32 | | - - node_modules |
| 45 | + key: deps1-{{ .Branch }}-{{ checksum "package.json" }} |
| 46 | + paths: |
| 47 | + - node_modules |
33 | 48 |
|
34 | 49 | - run: |
35 | | - name: Run eslint |
36 | | - command: ./node_modules/.bin/eslint src |
37 | | - when: always |
| 50 | + name: Run eslint |
| 51 | + command: npm run lint.eslint |
| 52 | + when: always |
38 | 53 |
|
| 54 | + - run: |
| 55 | + name: Run prettier |
| 56 | + command: npm run lint.prettier |
| 57 | + when: always |
| 58 | + |
| 59 | + python-3-11: &test-template |
| 60 | + executor: python-3-11-executor |
39 | 61 |
|
40 | | - "python-3.6": &test-template |
41 | | - docker: |
42 | | - - image: circleci/python:3.6-stretch-browsers |
43 | | - auth: |
44 | | - username: dashautomation |
45 | | - password: $DASH_PAT_DOCKERHUB |
46 | | - |
47 | 62 | environment: |
48 | 63 | PERCY_ENABLED: True |
49 | 64 | PERCY_PARALLEL_TOTAL: -1 |
50 | 65 |
|
51 | 66 | steps: |
52 | 67 | - checkout |
| 68 | + - browser-tools/install-chrome |
| 69 | + - browser-tools/install-chromedriver |
53 | 70 |
|
54 | 71 | - restore_cache: |
55 | | - key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }} |
| 72 | + key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }} |
56 | 73 |
|
57 | 74 | - run: |
58 | | - name: Create virtualenv |
59 | | - command: | |
60 | | - python3 -m venv venv |
| 75 | + name: Create virtualenv |
| 76 | + command: rm -rf venv && python -m venv venv |
61 | 77 |
|
62 | 78 | - run: |
63 | | - name: Install requirements |
64 | | - command: | |
65 | | - . venv/bin/activate |
66 | | - pip install -r tests/requirements.txt --quiet |
| 79 | + name: Install requirements |
| 80 | + command: . venv/bin/activate && pip install -r tests/requirements.txt |
67 | 81 |
|
68 | 82 | - save_cache: |
69 | | - key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }} |
70 | | - paths: |
71 | | - - "venv" |
72 | | - |
73 | | - - run: |
74 | | - name: Run pylint |
75 | | - command: | |
76 | | - . venv/bin/activate |
77 | | - pylint usage.py usage-advanced.py usage-elements.py usage-events.py usage-stylesheet.py |
78 | | - pylint demos tests |
79 | | - when: always |
| 83 | + key: deps1-{{ .Branch }}-{{ checksum "tests/requirements.txt" }} |
| 84 | + paths: |
| 85 | + - 'venv' |
80 | 86 |
|
81 | 87 | - run: |
82 | | - name: Run flake8 |
83 | | - command: | |
84 | | - . venv/bin/activate |
85 | | - flake8 --max-line-length=100 usage.py usage-advanced.py usage-elements.py usage-events.py usage-stylesheet.py |
86 | | - flake8 --max-line-length=100 demos tests |
87 | | - when: always |
| 88 | + name: Run lint for Python files |
| 89 | + command: | |
| 90 | + . venv/bin/activate |
| 91 | + npm run lint:python |
| 92 | + when: always |
88 | 93 |
|
89 | 94 | - run: |
90 | | - name: Integration Tests - Usage Apps Rendering |
91 | | - command: | |
92 | | - . venv/bin/activate |
93 | | - pytest --nopercyfinalize --headless tests/test_usage.py |
94 | | - when: always |
| 95 | + name: Integration Tests - Usage Apps Rendering |
| 96 | + command: | |
| 97 | + . venv/bin/activate |
| 98 | + pytest --nopercyfinalize --headless tests/test_usage.py |
| 99 | + when: always |
95 | 100 |
|
96 | 101 | - run: |
97 | | - name: Integration Tests - Interactions |
98 | | - command: | |
99 | | - . venv/bin/activate |
100 | | - pytest --headless tests/test_interactions.py |
101 | | - when: always |
| 102 | + name: Integration Tests - Interactions |
| 103 | + command: | |
| 104 | + . venv/bin/activate |
| 105 | + pytest --headless tests/test_interactions.py |
| 106 | + when: always |
102 | 107 |
|
103 | 108 | - run: |
104 | | - name: Integration Tests - Callbacks |
105 | | - command: | |
106 | | - . venv/bin/activate |
107 | | - pytest --headless tests/test_callbacks.py |
108 | | - when: always |
| 109 | + name: Integration Tests - Callbacks |
| 110 | + command: | |
| 111 | + . venv/bin/activate |
| 112 | + pytest --headless tests/test_callbacks.py |
| 113 | + when: always |
109 | 114 |
|
110 | 115 | - run: |
111 | | - name: Capture Percy Snapshots |
112 | | - command: | |
113 | | - . venv/bin/activate |
114 | | - pytest --headless tests/test_percy_snapshot.py |
115 | | - when: always |
| 116 | + name: Capture Percy Snapshots |
| 117 | + command: | |
| 118 | + . venv/bin/activate |
| 119 | + pytest --headless tests/test_percy_snapshot.py |
| 120 | + when: always |
116 | 121 |
|
117 | | - "python-3.7": |
| 122 | + python-3-6: |
118 | 123 | <<: *test-template |
119 | | - docker: |
120 | | - - image: circleci/python:3.7-stretch-browsers |
121 | | - auth: |
122 | | - username: dashautomation |
123 | | - password: $DASH_PAT_DOCKERHUB |
124 | | - |
| 124 | + executor: python-3-6-executor |
| 125 | + |
125 | 126 | environment: |
126 | 127 | PERCY_ENABLE: False |
127 | 128 |
|
| 129 | + python-3-11-react-18: |
| 130 | + <<: *test-template |
| 131 | + executor: python-3-11-executor |
| 132 | + |
| 133 | + environment: |
| 134 | + PERCY_ENABLE: False |
| 135 | + REACT_VERSION: '18.2.0' |
128 | 136 |
|
129 | 137 | workflows: |
130 | | - version: 2 |
| 138 | + version: 2.1 |
131 | 139 | build: |
132 | 140 | jobs: |
133 | | - - "python-3.6": |
134 | | - context: dash-docker-hub |
135 | | - - "python-3.7": |
136 | | - context: dash-docker-hub |
137 | | - - "node": |
138 | | - context: dash-docker-hub |
139 | | - - "percy-finalize": |
140 | | - requires: |
141 | | - - "python-3.6" |
| 141 | + - python-3-11 |
| 142 | + - python-3-6 |
| 143 | + - python-3-11-react-18 |
| 144 | + - node |
| 145 | + - percy-finalize: |
| 146 | + requires: |
| 147 | + - python-3-11 |
0 commit comments