diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 61db76e..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,117 +0,0 @@ -version: 2.1 - -orbs: - browser-tools: circleci/browser-tools@1.4.8 - -jobs: - python-3-8: &test-template - docker: - - image: cimg/python:3.8.20-browsers - auth: - username: dashautomation - password: $DASH_PAT_DOCKERHUB - - environment: - PERCY_ENABLE: 0 - - steps: - - checkout - - - browser-tools/install-browser-tools: - install-firefox: false - install-geckodriver: false - - - run: - name: โœ๏ธ Write job name. - command: echo $CIRCLE_JOB > circlejob.txt - - - restore_cache: - key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} - - - run: - name: ๐Ÿ—๏ธ Create venv - command: | - python -m venv venv - - - run: - name: ๐Ÿ—๏ธ Install requirements - command: | - . venv/bin/activate - pip install -r tests/requirements.txt --quiet - - - save_cache: - key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} - paths: - - venv - - - run: - name: ๐Ÿงช Generations tests - command: | - . venv/bin/activate - pytest - when: always - - python-3-12-install-test: - docker: - - image: cimg/python:3.12.7-browsers - auth: - username: dashautomation - password: $DASH_PAT_DOCKERHUB - - environment: - PERCY_ENABLE: 0 - - steps: - - checkout - - - browser-tools/install-browser-tools: - install-firefox: false - install-geckodriver: false - - - run: - name: โœ๏ธ Write job name. - command: echo $CIRCLE_JOB > circlejob.txt - - - restore_cache: - key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} - - - run: - name: ๐Ÿ—๏ธ Create venv - command: | - python -m venv venv - - - run: - name: ๐Ÿ—๏ธ Install requirements - command: | - . venv/bin/activate - pip install -r tests/requirements.txt --quiet - - - save_cache: - key: deps1-{{ .Branch }}-{{ checksum "circlejob.txt" }}-{{ checksum "tests/requirements.txt" }}-{{ checksum ".circleci/config.yml" }} - paths: - - venv - - - run: - name: ๐Ÿงช Generate Project & test - command: | - . venv/bin/activate - mkdir test_install - cd test_install - cookiecutter .. --config-file ../tests/test_config.yaml --no-input - cd test_component - python -m venv venv - . venv/bin/activate - pip install -r tests/requirements.txt --quiet - npm install --ignore-scripts - npm run build - pytest - - -workflows: - version: 2 - build: - jobs: - - python-3-8: - context: dash-docker-hub - - python-3-12-install-test: - context: dash-docker-hub diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e22a630 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,99 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: + +jobs: + python-3-8: + runs-on: ubuntu-latest + + env: + PERCY_ENABLE: 0 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - name: Set up Chrome + uses: browser-actions/setup-chrome@v1 + with: + install-chromedriver: true + + - name: Set up ChromeDriver + uses: browser-actions/setup-chromedriver@v1 + + - name: Cache pip dependencies + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-3.8-${{ hashFiles('tests/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip-3.8- + + - name: Install requirements + run: | + python -m pip install --upgrade pip + pip install -r tests/requirements.txt --quiet + + - name: Run tests + run: pytest + + python-3-12-install-test: + runs-on: ubuntu-latest + + env: + PERCY_ENABLE: 0 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Set up Chrome + uses: browser-actions/setup-chrome@v1 + with: + install-chromedriver: true + + - name: Cache pip dependencies + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-3.12-${{ hashFiles('tests/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip-3.12- + + - name: Install requirements + run: | + python -m pip install --upgrade pip + pip install -r tests/requirements.txt --quiet + + - name: Generate project and test + run: | + mkdir test_install + cd test_install + cookiecutter .. --config-file ../tests/test_config.yaml --no-input + cd test_component + python -m venv venv + . venv/bin/activate + pip install -r tests/requirements.txt --quiet + npm install --ignore-scripts + npm run build + pytest