Skip to content

Add docker-based integration test commands #131

Add docker-based integration test commands

Add docker-based integration test commands #131

Workflow file for this run

name: Check Commit
on:
push:
branches: master
pull_request:
branches: '*'
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
dedupe:
name: Dedupe check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@94b14ddfbdd1ed651e9f9343ae2409ab5c73a6a8 # v0.35.0
- name: Install dependencies
run: |
set -eux
python -m pip install -U "jupyterlab>=4.0.0,<5"
jlpm install
- name: Ensure dependencies are deduplicated
run: jlpm dedupe --check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@94b14ddfbdd1ed651e9f9343ae2409ab5c73a6a8 # v0.35.0
- name: Install dependencies
run: |
set -eux
python -m pip install -U "jupyterlab>=4.0.0,<5"
jlpm install
- name: Lint the extension
run: jlpm run lint:check
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@94b14ddfbdd1ed651e9f9343ae2409ab5c73a6a8 # v0.35.0
- name: Install dependencies
run: |
set -eux
python -m pip install -U "jupyterlab>=4.0.0,<5"
jlpm install
- name: Test the extension
run: jlpm run test
- name: Build the extension
run: |
set -eux
python -m pip install .[test]
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyter-ruff.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "jupyter_ruff" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: extension-artifacts
path: dist/jupyter_ruff*
if-no-files-found: error
test_isolated:
name: Isolated tests
needs: build
runs-on: ubuntu-latest
steps:
- name: Install Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.10'
architecture: 'x64'
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: extension-artifacts
- name: Install and Test
run: |
set -eux
# Remove NodeJS, twice to take care of system and locally installed node versions.
sudo rm -rf $(which node)
sudo rm -rf $(which node)
pip install "jupyterlab>=4.0.0,<5" jupyter_ruff*.whl
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyter-ruff.*OK"
python -m jupyterlab.browser_check --no-browser-test
integration_tests:
name: Integration tests
needs: build
runs-on: ubuntu-latest
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@94b14ddfbdd1ed651e9f9343ae2409ab5c73a6a8 # v0.35.0
- name: Download extension package
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: extension-artifacts
- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" jupyter_ruff*.whl
- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install
- name: Set up browser cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}
- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests
- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test
- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: jupyter_ruff-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report