Skip to content

Commit

Permalink
update the test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dou Du committed Jun 10, 2024
1 parent 6b835ee commit 31d12aa
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 39 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/screenshot-comparison.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: screenshot comparison

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
check-screenshot:
name: Check Screenshot
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '21.x'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
- name: Install dependencies
run:
pip install --upgrade pip
pip install --upgrade jupyterlab
pip install --upgrade voila
pip install --upgrade voila-osscar-template
pip install -e .

- name: Run the voila server
run: |
voila --template=osscar --enable_nbextensions=True example/ --port 8383 --no-browser &
pip install --upgrade pytest
pip install --upgrade selenium
pip install --upgrade Pillow
- uses: nanasess/setup-chromedriver@master
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
python3 $GITHUB_WORKSPACE/test/test.py
python3 $GITHUB_WORKSPACE/test/test_figures.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Voila test
name: widget test

on:
push:
Expand Down Expand Up @@ -51,41 +51,3 @@ jobs:
name: artifact
path: './*.png'

check-screenshot:
name: Check Screenshot
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '21.x'
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
- name: Install dependencies
run:
pip install --upgrade pip
pip install --upgrade jupyterlab
pip install --upgrade voila
pip install --upgrade voila-osscar-template
pip install -e .

- name: Run the voila server
run: |
voila --template=osscar --enable_nbextensions=True example/ --port 8383 --no-browser &
pip install --upgrade pytest
pip install --upgrade selenium
pip install --upgrade Pillow
- uses: nanasess/setup-chromedriver@master
- run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
python3 $GITHUB_WORKSPACE/test/test.py
python3 $GITHUB_WORKSPACE/test/test_figures.py

0 comments on commit 31d12aa

Please sign in to comment.