From e03043a00aea8fd79fc3dd53dfcc5925486ec09b Mon Sep 17 00:00:00 2001 From: philippe Date: Thu, 16 Apr 2026 15:27:05 -0400 Subject: [PATCH 1/3] migrate circleci to github action --- .circleci/config.yml | 117 --------------------------------------- .github/workflows/ci.yml | 95 +++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 117 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml 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..4c89601 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,95 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +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: 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 From 76d0724254fbdea0f837ee889bffeb930a23da74 Mon Sep 17 00:00:00 2001 From: philippe Date: Thu, 16 Apr 2026 16:14:03 -0400 Subject: [PATCH 2/3] separate chromedriver install --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c89601..181ce9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,9 @@ jobs: - 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 @@ -65,8 +66,9 @@ jobs: - 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 From 181b0bb1dc352fd1942b4827713831a2061da080 Mon Sep 17 00:00:00 2001 From: Philippe Duval Date: Tue, 21 Apr 2026 11:55:29 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Cameron DeCoster --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 181ce9a..e22a630 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: [master] pull_request: branches: [master] + workflow_dispatch: jobs: python-3-8: @@ -24,6 +25,8 @@ jobs: - name: Set up Chrome uses: browser-actions/setup-chrome@v1 + with: + install-chromedriver: true - name: Set up ChromeDriver uses: browser-actions/setup-chromedriver@v1 @@ -66,9 +69,8 @@ jobs: - name: Set up Chrome uses: browser-actions/setup-chrome@v1 - - - name: Set up ChromeDriver - uses: browser-actions/setup-chromedriver@v1 + with: + install-chromedriver: true - name: Cache pip dependencies uses: actions/cache@v4