Skip to content

Feat: pane export in png, jpg and svg #3142

Feat: pane export in png, jpg and svg

Feat: pane export in png, jpg and svg #3142

Workflow file for this run

name: Test changes
on: pull_request
# push:
# branches:
# - master
jobs:
lint-js:
name: "Javascript Linter Check"
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- name: "Install Node"
uses: actions/setup-node@v7.0.0
with:
node-version: '24'
- name: "Install Dependencies"
run: ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
- name: "Linter Check (ESLint)"
run: npm run lint
lint-py:
name: "Python Linter Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.0
- uses: psf/black@26.5.1
with:
src: "./py"
version: 23.1.0
- name: Check for Linting Errors
if: failure()
run: echo "::warning title='Python Linter Check failed'::Please run \"pip install black; black py\" before committing code changes to python files."
install-and-build:
name: "Install and Build"
runs-on: ubuntu-latest
outputs:
jsfileschanged: ${{ steps.checkout.outputs.jsfileschanged }}
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
with:
loadprbuild: false
# count changed js files (diff to base branch)
- name: "Count changed JS-Files"
id: checkout
run: |
git fetch origin $GITHUB_BASE_REF
echo "Target branch : $GITHUB_BASE_REF"
git diff --name-only origin/$GITHUB_BASE_REF --
echo 'jsfileschanged='$(git diff --name-only origin/$GITHUB_BASE_REF -- | grep '^js/*' | wc -l) >> $GITHUB_OUTPUT
echo 'Num js files changed='$(git diff --name-only origin/$GITHUB_BASE_REF -- | grep '^js/*' | wc -l)
- name: "Build Project (PR version)"
run: |
npm run build
if: steps.checkout.outputs.jsfileschanged > 0
- name: "Save built js-files"
uses: actions/upload-artifact@v7
with:
name: pr-build
if-no-files-found: error
path: |
./py/visdom/static/js/main.js
./py/visdom/static/js/main.js.map
visual-regression-test-init:
name: "Initialize Visual Regression Test"
runs-on: ubuntu-latest
needs: install-and-build
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- name: "Save current Head-Ref as PR-branch"
shell: bash
run: |
git checkout -B PR-HEAD
- uses: ./.github/actions/prepare
with:
usebasebranch: true
loadprbuild: false
- name: "Checkout Tests from Head-Ref"
shell: bash
run: |
git checkout PR-HEAD -- ./cypress
git checkout PR-HEAD -- ./example
git checkout PR-HEAD -- ./package.json
git checkout PR-HEAD -- ./cypress.config.js
- name: "Install PR npm dependencies"
shell: bash
run: ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
- name: Cypress test:init
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
spec: cypress/integration/*.init.js
- uses: actions/upload-artifact@v7
with:
name: cypress-init-screenshots
path: cypress/screenshots_init
visual-regression-test:
name: "Visual Regression Test"
runs-on: ubuntu-latest
needs: visual-regression-test-init
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
- uses: actions/download-artifact@v8
with:
name: cypress-init-screenshots
path: cypress/screenshots_init
- name: Cypress test:visual
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
spec: cypress/integration/screenshots.js
- uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress-screenshots-visual
path: cypress/screenshots
playwright-visual-regression-test-init:
name: "Initialize Playwright Visual Regression Test"
runs-on: ubuntu-latest
needs: install-and-build
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- name: "Save current Head-Ref as PR-branch"
shell: bash
run: git checkout -B PR-HEAD
- uses: ./.github/actions/prepare
with:
usebasebranch: true
loadprbuild: false
- name: "Checkout Playwright tests from Head-Ref"
shell: bash
run: |
git checkout PR-HEAD -- ./playwright
git checkout PR-HEAD -- ./example
git checkout PR-HEAD -- ./package.json
git checkout PR-HEAD -- ./playwright.config.js
git checkout PR-HEAD -- ./playwright.init.config.js
git checkout PR-HEAD -- ./playwright.visual.config.js
- name: "Install PR npm dependencies"
run: ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install
- name: "Install Playwright Chromium"
run: npx playwright install --with-deps chromium
- name: "Generate Playwright baseline screenshots"
run: npm run test:pw:init
- uses: actions/upload-artifact@v7
with:
name: playwright-init-screenshots
path: playwright/screenshots_init
playwright-visual-regression-test:
name: "Playwright Visual Regression Test"
runs-on: ubuntu-latest
needs: playwright-visual-regression-test-init
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
- name: "Install Playwright Chromium"
run: npx playwright install --with-deps chromium
- uses: actions/download-artifact@v8
with:
name: playwright-init-screenshots
path: playwright/screenshots_init
- name: "Run Playwright visual regression tests"
run: npm run test:pw:visual
- uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-screenshots-visual
path: |
playwright/test-results/
playwright/playwright-report/
functional-test:
name: "Functional Test (Websocket)"
runs-on: ubuntu-latest
needs: install-and-build
strategy:
matrix:
python: ['3.12', '3.13']
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
with:
python-version: ${{ matrix.python }}
- name: Cypress test
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
config: excludeSpecPattern=**/screenshots.*
- uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress-screenshots-functional-${{ matrix.python }}
path: cypress/screenshots
functional-test-polling:
name: 'Functional Test (Polling)'
runs-on: ubuntu-latest
needs: install-and-build
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
- name: Cypress test
uses: cypress-io/github-action@v7
with:
install: false
browser: chrome
start: visdom -port 8098 -env_path /tmp -use_frontend_client_polling
wait-on: 'http://localhost:8098'
env: CYPRESS_CHROME_ARGS="--disable-gpu --disable-dev-shm-usage --no-sandbox --disable-setuid-sandbox"
config: excludeSpecPattern=**/screenshots.*
- uses: actions/upload-artifact@v7
if: failure()
with:
name: cypress-screenshots-functional-polling
path: cypress/screenshots
playwright-test:
name: "Playwright Functional Test"
runs-on: ubuntu-latest
needs: install-and-build
steps:
- name: "Checkout Repository"
uses: actions/checkout@v7.0.0
- uses: ./.github/actions/prepare
- name: Install Playwright Chromium
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npm run test:pw
- name: Upload Playwright Report
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-report
path: playwright/playwright-report/