-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
97 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,49 +1,58 @@ | ||
name: screenshot comparison | ||
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: 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 . | ||
pip install --upgrade selenium | ||
pip install --upgrade Pillow | ||
pip install --upgrade pytest | ||
- 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 | ||
- name: Run the voila server | ||
run: | | ||
voila --template=osscar --enable_nbextensions=True example/ --port 8383 --no-browser & | ||
- 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 | ||
- uses: nanasess/setup-chromedriver@master | ||
- name: Generate the screenshots | ||
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 | ||
- name: Upload screenshots | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifact | ||
path: "./*.png" | ||
|
||
- name: Compare the screenshots to the reference one | ||
run: | | ||
python3 $GITHUB_WORKSPACE/test/test_figures.py |
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