-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from plotly/use-gha
Use Github Actions rather than Circle for automated tests
- Loading branch information
Showing
2 changed files
with
102 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |