Skip to content

✨ Add Core Workflow Examples #651

✨ Add Core Workflow Examples

✨ Add Core Workflow Examples #651

Workflow file for this run

name: Frontend Playwright Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the tests on'
required: false
default: 'master'
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set Branch Name
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "branch_name=${{ github.event.inputs.branch }}" >> $GITHUB_ENV
else
echo "branch_name=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Check Branch
run: echo "Branch name is ${{ env.branch_name }}"
- name: Get Hash
run: echo "git_hash=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
- name: Check Hash
run: echo "Git hash is ${{ env.git_hash }}"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Yarn
run: npm install --global yarn
- name: Build Extension in Dev Mode
run: pip install -e .
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Build Wheel
run: |
python -m pip install --upgrade build
python -m build
- name: Install Xircuits from wheel
run: |
whl_name=$(ls dist/*.whl)
pip install $whl_name
- name: Install Xircuits Test Component Library
run: xircuits install tests
- name: Install xvfb
run: sudo apt-get install -y xvfb
- name: Test E2E
run: |
(jupyter lab --ServerApp.token='' --ServerApp.password='' --LabApp.default_url='/lab?reset' &) && cd ui-tests && jlpm install && jlpm playwright install && xvfb-run jlpm playwright test e2e/datatype-test.spec.ts
- uses: actions/upload-artifact@v3
if: failure()
with:
name: playwright-report-${{ matrix.python-version }}-${{ env.branch_name }}-${{ env.git_hash }}
path: ui-tests/playwright-report/
retention-days: 1