|
| 1 | +version: 2.1 |
| 2 | + |
| 3 | +orbs: |
| 4 | + browser-tools: circleci/browser-tools@1.4.8 |
| 5 | + |
| 6 | +jobs: |
| 7 | + python-3-8: &test-template |
| 8 | + docker: |
| 9 | + - image: cimg/python:3.8.20-browsers |
| 10 | + auth: |
| 11 | + username: dashautomation |
| 12 | + password: $DASH_PAT_DOCKERHUB |
| 13 | + |
| 14 | + environment: |
| 15 | + PERCY_ENABLE: 0 |
| 16 | + |
| 17 | + steps: |
| 18 | + - checkout |
| 19 | + |
| 20 | + - browser-tools/install-browser-tools: |
| 21 | + install-firefox: false |
| 22 | + install-geckodriver: false |
| 23 | + |
| 24 | + - run: |
| 25 | + name: ✍️ Write job name. |
| 26 | + command: echo $CIRCLE_JOB > circlejob.txt |
| 27 | + |
| 28 | + - restore_cache: |
| 29 | + key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} |
| 30 | + |
| 31 | + - run: |
| 32 | + name: 🏗️ Create venv |
| 33 | + command: | |
| 34 | + python -m venv venv |
| 35 | +
|
| 36 | + - run: |
| 37 | + name: 🏗️ Install requirements |
| 38 | + command: | |
| 39 | + . venv/bin/activate |
| 40 | + pip install -r tests/requirements.txt --quiet |
| 41 | +
|
| 42 | + - save_cache: |
| 43 | + key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} |
| 44 | + paths: |
| 45 | + - venv |
| 46 | + |
| 47 | + - run: |
| 48 | + name: 🧪 Generations tests |
| 49 | + command: | |
| 50 | + . venv/bin/activate |
| 51 | + pytest |
| 52 | + when: always |
| 53 | + |
| 54 | + python-3-12-install-test: |
| 55 | + docker: |
| 56 | + - image: cimg/python:3.12.7-browsers |
| 57 | + auth: |
| 58 | + username: dashautomation |
| 59 | + password: $DASH_PAT_DOCKERHUB |
| 60 | + |
| 61 | + environment: |
| 62 | + PERCY_ENABLE: 0 |
| 63 | + |
| 64 | + steps: |
| 65 | + - checkout |
| 66 | + |
| 67 | + - browser-tools/install-browser-tools: |
| 68 | + install-firefox: false |
| 69 | + install-geckodriver: false |
| 70 | + |
| 71 | + - run: |
| 72 | + name: ✍️ Write job name. |
| 73 | + command: echo $CIRCLE_JOB > circlejob.txt |
| 74 | + |
| 75 | + - restore_cache: |
| 76 | + key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} |
| 77 | + |
| 78 | + - run: |
| 79 | + name: 🏗️ Create venv |
| 80 | + command: | |
| 81 | + python -m venv venv |
| 82 | +
|
| 83 | + - run: |
| 84 | + name: 🏗️ Install requirements |
| 85 | + command: | |
| 86 | + . venv/bin/activate |
| 87 | + pip install -r tests/requirements.txt --quiet |
| 88 | +
|
| 89 | + - save_cache: |
| 90 | + key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} |
| 91 | + paths: |
| 92 | + - venv |
| 93 | + |
| 94 | + - run: |
| 95 | + name: 🧪 Generate Project & test |
| 96 | + command: | |
| 97 | + . venv/bin/activate |
| 98 | + mkdir test_install |
| 99 | + cd test_install |
| 100 | + cookiecutter .. --config-file ../tests/test_config.yaml --no-input |
| 101 | + cd test_component |
| 102 | + python -m venv venv |
| 103 | + . venv/bin/activate |
| 104 | + pip install -r tests/requirements.txt --quiet |
| 105 | + npm install --ignore-scripts |
| 106 | + npm run build |
| 107 | + pytest |
| 108 | +
|
| 109 | +
|
| 110 | +workflows: |
| 111 | + version: 2 |
| 112 | + build: |
| 113 | + jobs: |
| 114 | + - python-3-8: |
| 115 | + context: dash-docker-hub |
| 116 | + - python-3-12-install-test: |
| 117 | + context: dash-docker-hub |
0 commit comments