Skip to content

Commit 8dc1858

Browse files
author
Dou Du
committed
add new tests workflow
1 parent 69a6856 commit 8dc1858

File tree

2 files changed

+62
-15
lines changed

2 files changed

+62
-15
lines changed

.github/workflows/voila-test.yml renamed to .github/workflows/screenshot-comparison.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Voila test
1+
name: screenshot comparison
22

33
on:
44
push:
@@ -9,19 +9,20 @@ on:
99
- '*'
1010

1111
jobs:
12-
voila:
12+
check-screenshot:
13+
name: Check Screenshot
1314
runs-on: ubuntu-latest
1415
steps:
1516
- name: Checkout
16-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1718
- name: Install node
18-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v4
1920
with:
20-
node-version: '18.x'
21+
node-version: '21.x'
2122
- name: Install Python
22-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v5
2324
with:
24-
python-version: '3.9'
25+
python-version: '3.11'
2526
architecture: 'x64'
2627
- name: Install dependencies
2728
run:
@@ -45,13 +46,5 @@ jobs:
4546
chromedriver --url-base=/wd/hub &
4647
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
4748
python3 $GITHUB_WORKSPACE/test/test.py
48-
49-
- uses: actions/upload-artifact@v2
50-
with:
51-
name: quantum-screenshot
52-
path: './*.png'
53-
54-
- name: Run the figures test
55-
run: |
5649
python3 $GITHUB_WORKSPACE/test/test_figures.py
5750

.github/workflows/widget-test.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: widget test
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
check-elements:
13+
name: Check Element
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Install node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '21.x'
22+
- name: Install Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.11'
26+
architecture: 'x64'
27+
- name: Install dependencies
28+
run:
29+
pip install --upgrade pip
30+
pip install --upgrade jupyterlab
31+
pip install --upgrade voila
32+
pip install --upgrade voila-osscar-template
33+
pip install --upgrade ase
34+
pip install -e .
35+
36+
- name: Run the voila server
37+
run: |
38+
voila --template=osscar --enable_nbextensions=True example/ --port 8383 --no-browser &
39+
pip install --upgrade pytest
40+
pip install --upgrade selenium
41+
pip install --upgrade Pillow
42+
43+
- uses: nanasess/setup-chromedriver@master
44+
- run: |
45+
export DISPLAY=:99
46+
chromedriver --url-base=/wd/hub &
47+
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
48+
python3 $GITHUB_WORKSPACE/test/test.py
49+
50+
- uses: actions/upload-artifact@v4
51+
with:
52+
name: artifact
53+
path: './*.png'
54+

0 commit comments

Comments
 (0)