From 31d12aa9f5ceb530806d05c5dc895887ff382235 Mon Sep 17 00:00:00 2001 From: Dou Du Date: Mon, 10 Jun 2024 12:20:30 +0200 Subject: [PATCH] update the test workflow --- .github/workflows/screenshot-comparison.yml | 49 +++++++++++++++++++ .../{voila-test.yml => widget-test.yml} | 40 +-------------- 2 files changed, 50 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/screenshot-comparison.yml rename .github/workflows/{voila-test.yml => widget-test.yml} (52%) diff --git a/.github/workflows/screenshot-comparison.yml b/.github/workflows/screenshot-comparison.yml new file mode 100644 index 0000000..e41ebba --- /dev/null +++ b/.github/workflows/screenshot-comparison.yml @@ -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 + diff --git a/.github/workflows/voila-test.yml b/.github/workflows/widget-test.yml similarity index 52% rename from .github/workflows/voila-test.yml rename to .github/workflows/widget-test.yml index 63ce43a..df7a0be 100644 --- a/.github/workflows/voila-test.yml +++ b/.github/workflows/widget-test.yml @@ -1,4 +1,4 @@ -name: Voila test +name: widget test on: push: @@ -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 -