diff --git a/.github/workflows/voila-test.yml b/.github/workflows/screenshot-comparison.yml similarity index 76% rename from .github/workflows/voila-test.yml rename to .github/workflows/screenshot-comparison.yml index 9b3fb35..9bf19a0 100644 --- a/.github/workflows/voila-test.yml +++ b/.github/workflows/screenshot-comparison.yml @@ -1,4 +1,4 @@ -name: Voila test +name: screenshot comparison on: push: @@ -9,19 +9,20 @@ on: - '*' jobs: - voila: + check-screenshot: + name: Check Screenshot runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version: '21.x' - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.11' architecture: 'x64' - name: Install dependencies run: @@ -45,13 +46,5 @@ jobs: chromedriver --url-base=/wd/hub & sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional python3 $GITHUB_WORKSPACE/test/test.py - - - uses: actions/upload-artifact@v2 - with: - name: quantum-screenshot - path: './*.png' - - - name: Run the figures test - run: | python3 $GITHUB_WORKSPACE/test/test_figures.py diff --git a/.github/workflows/widget-test.yml b/.github/workflows/widget-test.yml new file mode 100644 index 0000000..5025f1b --- /dev/null +++ b/.github/workflows/widget-test.yml @@ -0,0 +1,54 @@ +name: widget test + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +jobs: + check-elements: + name: Check Element + 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 --upgrade ase + 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 + + - uses: actions/upload-artifact@v4 + with: + name: artifact + path: './*.png' +