Skip to content

Commit

Permalink
Merge pull request #289 from plotly/use-gha
Browse files Browse the repository at this point in the history
Use Github Actions rather than Circle for automated tests
  • Loading branch information
ndrezn authored Apr 23, 2024
2 parents 162047c + e61aab0 commit c1eef68
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 53 deletions.
53 changes: 0 additions & 53 deletions .circleci/config.yml

This file was deleted.

102 changes: 102 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Run tests

on:
push:
branches: [main]
tags:
- v*
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: 'Setup Chrome and chromedriver'
uses: nanasess/setup-chromedriver@v2
- name: 'Setup chromedriver environment'
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
- name: Start XVFB
run: Xvfb :99 &

- name: Setup uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
- name: Install dependencies
run: |
source .venv/bin/activate
uv pip install --upgrade pip
uv pip install wheel
uv pip install ".[dev]"
- name: Build package
run: |
source .venv/bin/activate
npm ci
npm i
npm run build
timeout-minutes: 20

- name: Lint
run: npm run lint

- name: Run tests
run: |
source .venv/bin/activate
pytest --headless
test-react:
runs-on: ubuntu-latest
strategy:
matrix:
react-version: ["18.2.0"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.12
- name: 'Setup Chrome and chromedriver'
uses: nanasess/setup-chromedriver@v2

- name: 'Setup chromedriver environment'
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
- name: Start XVFB
run: Xvfb :99 &

- name: Setup uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
- name: Install package
run: |
source .venv/bin/activate
uv pip install --upgrade pip
uv pip install wheel
uv pip install ".[dev]"
echo "Using React version ${{ matrix.react-version }}"
npm ci
npm install react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}
npm i
npm run build
timeout-minutes: 20
- run: npm run lint
- run: |
source .venv/bin/activate
pytest --headless

0 comments on commit c1eef68

Please sign in to comment.